chiark / gitweb /
Move is_fast_fwd into Dgit.pm
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 21 May 2015 06:40:46 +0000 (07:40 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 31 May 2015 10:54:15 +0000 (11:54 +0100)
Debian/Dgit.pm
dgit

index 2c9c9f9..f20f1bc 100644 (file)
@@ -19,7 +19,7 @@ BEGIN {
                       stat_exists fail waitstatusmsg failedcmd
                       cmdoutput cmdoutput_errok
                       git_rev_parse git_for_each_ref
-                      git_for_each_tag_referring
+                      git_for_each_tag_referring is_fast_fwd
                       $package_re $component_re $deliberately_re
                       $branchprefix
                       initdebug enabledebug enabledebuglevel
@@ -211,4 +211,16 @@ sub git_for_each_tag_referring ($$) {
     });
 }
 
+sub is_fast_fwd ($$) {
+    my ($ancestor,$child) = @_;
+    my @cmd = (qw(git merge-base), $ancestor, $child);
+    my $mb = cmdoutput_errok @cmd;
+    if (defined $mb) {
+       return git_rev_parse($mb) eq git_rev_parse($ancestor);
+    } else {
+       $?==256 or failedcmd @cmd;
+       return 0;
+    }
+}
+
 1;
diff --git a/dgit b/dgit
index c6a3596..9b401a2 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -1271,18 +1271,6 @@ sub ensure_we_have_orig () {
     }
 }
 
-sub is_fast_fwd ($$) {
-    my ($ancestor,$child) = @_;
-    my @cmd = (@git, qw(merge-base), $ancestor, $child);
-    my $mb = cmdoutput_errok @cmd;
-    if (defined $mb) {
-       return git_rev_parse($mb) eq git_rev_parse($ancestor);
-    } else {
-       $?==256 or failedcmd @cmd;
-       return 0;
-    }
-}
-
 sub git_fetch_us () {
     runcmd_ordryrun_local @git, qw(fetch),access_giturl(),fetchspec();
 }