summaryrefslogtreecommitdiff
path: root/dgit
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2013-08-26 16:35:58 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2013-08-26 16:35:58 +0100
commit2c84b46d621bb5908bbfc64b9fcb12c30ab6b4a2 (patch)
tree3d2e363568beb960fc27b5533524aadf3a8d599e /dgit
parent11af4ca5c08cf0b6fc8fa211640be6aa119917d6 (diff)
is_fast_fwd simply returns false if no common history (pursuant to #720896)
Diffstat (limited to 'dgit')
-rwxr-xr-xdgit10
1 files changed, 8 insertions, 2 deletions
diff --git a/dgit b/dgit
index a8077a8..f582be0 100755
--- a/dgit
+++ b/dgit
@@ -639,8 +639,14 @@ sub rev_parse ($) {
sub is_fast_fwd ($$) {
my ($ancestor,$child) = @_;
- my $mb = cmdoutput @git, qw(merge-base), $ancestor, $child;
- return rev_parse($mb) eq rev_parse($ancestor);
+ my @cmd = (@git, qw(merge-base), $ancestor, $child);
+ my $mb = cmdoutput_errok @cmd;
+ if (defined $mb) {
+ return rev_parse($mb) eq rev_parse($ancestor);
+ } else {
+ $?==256 or failedcmd @cmd;
+ return 0;
+ }
}
sub git_fetch_us () {