chiark / gitweb /
dgit: --overwrite now no longer crashes if there is no $archive_hash
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 21 Jun 2018 00:20:01 +0000 (01:20 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 21 Jun 2018 00:32:31 +0000 (01:32 +0100)
Ie there is nothing to overwrite (eg, when used with --new).  Instead,
it is simply ignored, as it is ignored in situations where the push is
fast forward.

Closes:#863576.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
debian/changelog
dgit

index b34b4a0e090ed0041456966ab9faac9e8631b4c0..437bd53bfd24981b5aa9f5a1f2eff9609276cd29 100644 (file)
@@ -14,6 +14,9 @@ dgit (5.2~) unstable; urgency=medium
     happes to be a noop) but --dry-run was specified, fail with an
     explanation, rather than looping with a false coplaint about git
     fetch.  Closes:#871317.
+  * --overwrite now no longer crashes if there is nothing to overwrite
+    (eg, when used with --new).  Instead, it is simply ignored, as it is
+    ignored in situations where the push is fast forward.  Closes:#863576.
 
   test suite:
   * Use nproc(1) rather than Sys::CPU.  This is more portable and does not
diff --git a/dgit b/dgit
index 3409e18df6a9d773fed86ee4ebcf32cc43720f8d..5a6b2b68ea8c1937a0b4622a243c201b86137891 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -4301,7 +4301,8 @@ END
        }
     }
 
-    if (defined $overwrite_version && !defined $maintviewhead) {
+    if (defined $overwrite_version && !defined $maintviewhead
+       && $archive_hash) {
        $dgithead = plain_overwrite_pseudomerge($clogp,
                                                $dgithead,
                                                $archive_hash);