From: Ross Lagerwall <rosslagerwall@gmail.com>
To: git@vger.kernel.org
Cc: Ross Lagerwall <rosslagerwall@gmail.com>
Subject: [PATCH] difftool: silence warning
Date: Tue, 21 Aug 2012 08:59:18 +0200 [thread overview]
Message-ID: <1345532358-11742-1-git-send-email-rosslagerwall@gmail.com> (raw)
Silence a warning given when running git difftool --dir-diff and
there are no changes.
This is because command_oneline returns undef when the command has no
output, not ''.
Signed-off-by: Ross Lagerwall <rosslagerwall@gmail.com>
---
git-difftool.perl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/git-difftool.perl b/git-difftool.perl
index ae1e052..1cfcbb3 100755
--- a/git-difftool.perl
+++ b/git-difftool.perl
@@ -117,7 +117,7 @@ sub setup_dir_diff
# by Git->repository->command*.
my $diffrepo = Git->repository(Repository => $repo_path, WorkingCopy => $workdir);
my $diffrtn = $diffrepo->command_oneline('diff', '--raw', '--no-abbrev', '-z', @ARGV);
- exit(0) if (length($diffrtn) == 0);
+ exit(0) unless defined($diffrtn);
# Setup temp directories
my $tmpdir = tempdir('git-diffall.XXXXX', CLEANUP => 1, TMPDIR => 1);
--
1.7.11.4
next reply other threads:[~2012-08-21 6:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-21 6:59 Ross Lagerwall [this message]
2012-08-21 9:04 ` [PATCH] difftool: silence warning David Aguilar
2012-08-21 9:42 ` Ross Lagerwall
-- strict thread matches above, loose matches on Subject: below --
2012-08-21 10:21 Ross Lagerwall
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1345532358-11742-1-git-send-email-rosslagerwall@gmail.com \
--to=rosslagerwall@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).