summaryrefslogtreecommitdiff
path: root/dgit
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2013-08-14 19:22:14 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2013-08-14 19:22:14 +0100
commit6347d3e236ba3b578c1a6a259f51fc977e71b210 (patch)
tree0d2708d9532bbf2d4a838ee8a0920be0e7d65cc6 /dgit
parent682d66806b24a9d68b0d0cf4da96a8259267341e (diff)
fix is_fast_fwd (rename and introduce rev parse)
Diffstat (limited to 'dgit')
-rwxr-xr-xdgit10
1 files changed, 7 insertions, 3 deletions
diff --git a/dgit b/dgit
index 072f858..55cdc0c 100755
--- a/dgit
+++ b/dgit
@@ -216,10 +216,14 @@ END
my $lastupl_ref = "refs/remotes/$remotename/upload/$suite";
-sub is_fast_ff ($$) {
+sub rev_parse ($) {
+ return cmdoutput qw(git rev-parse --), "$_[0]~0";
+}
+
+sub is_fast_fwd ($$) {
my ($ancestor,$child) = @_;
my $mb = cmdoutput qw(git merge-base), $dsc_hash, $lastupl_hash;
- return $mb eq $ancestor;
+ return rev_parse($mb) eq rev_parse($ancestor);
}
sub fetch_from_archive () {
@@ -238,7 +242,7 @@ sub fetch_from_archive () {
if ($lastupl_hash) {
die "not fast forward on last upload branch!".
" (archive's version left in DGIT_ARCHIVE)"
- unless is_fast_ff($lastupl_hash, $dsc_hash);
+ unless is_fast_fwd($lastupl_hash, $dsc_hash);
}
if ($lastupl_ref ne $hash) {
cmdoutput qw(git update-ref -m), 'dgit fetch', $lastupl_ref, $hash;