chiark / gitweb /
Fix comparison of archive's .dsc's hash and git branch head to DTRT.
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 23 Aug 2013 11:15:10 +0000 (12:15 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 23 Aug 2013 11:15:10 +0000 (12:15 +0100)
debian/changelog
dgit

index a57cd2f37613e306bee611712d3646db360908f1..79fcea03b2c3441f08ff469f1904c75f2ff56eb8 100644 (file)
@@ -1,10 +1,12 @@
 dgit (0.8) unstable; urgency=low
 
+  * Fix comparison of archive's .dsc's hash and git branch head
+    to DTRT.
   * When creating repos in dgit-repos (using the ssh-cmd method),
     copy _template rather than using mkdir and git init.
     Closes: #720522.
 
- -- Ian Jackson <ijackson@chiark.greenend.org.uk>  Fri, 23 Aug 2013 12:03:25 +0100
+ --
 
 dgit (0.7) unstable; urgency=low
 
diff --git a/dgit b/dgit
index 94adcb5fd856349b8a2ec52bb56d1de74738257a..8911c8e2a35c1fe0d05df4e98f735744a0c47aaf 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -659,11 +659,12 @@ sub fetch_from_archive () {
     if (defined $dsc_hash) {
        fail "missing git history even though dsc has hash -".
            " could not find commit $dsc_hash".
-           " (should be in ".access_giturl()."#".rref().")"
+           " (should be in ".access_giturl()."#".rrref().")"
            unless $upload_hash;
        $hash = $dsc_hash;
        ensure_we_have_orig();
-       if (is_fast_fwd($dsc_hash,$upload_hash)) {
+       if ($dsc_hash eq $upload_hash) {
+       } elsif (is_fast_fwd($dsc_hash,$upload_hash)) {
            print STDERR <<END or die $!;
 
 Git commit in archive is behind the last version allegedly pushed/uploaded.
@@ -672,6 +673,9 @@ Last allegedly pushed/uploaded: $upload_hash
 $later_warning_msg
 END
            $hash = $upload_hash;
+       } else {
+           fail "archive's .dsc refers to ".$dsc_hash.
+               " but this is an ancestor of ".$upload_hash;
        }
     } else {
        $hash = generate_commit_from_dsc();