chiark / gitweb /
dgit: do not crash on push of a new gdr package. Closes:#906784.
[dgit.git] / dgit
diff --git a/dgit b/dgit
index 6377e327091bfd900ddaa0746b78aaf998aa6660..f06087d3cff655830af4b7cff78619b9e4584884 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -311,7 +311,7 @@ sub branch_is_gdr_unstitched_ff ($$$) {
     my ($symref, $head, $ancestor) = @_;
     my ($ffq_prev, $gdrlast) = branch_gdr_info($symref, $head);
     return 0 unless $ffq_prev;
-    return 0 unless is_fast_fwd $ancestor, $ffq_prev;
+    return 0 unless !defined $ancestor or is_fast_fwd $ancestor, $ffq_prev;
     return 1;
 }
 
@@ -5928,9 +5928,14 @@ END
         push @failsuggestion, [ 'applied',
                                "This might be a patches-applied branch." ];
     }
-    push @failsuggestion, [ 'quilt-mode', "Maybe you need to specify one of".
-        " --[quilt=]gbp --[quilt=]dpm --quilt=unapplied ?" ],
-           [ 'origs',
+    push @failsuggestion, [ 'quilt-mode',
+ "Maybe you need one of --[quilt=]gbp --[quilt=]dpm --quilt=unapplied ?" ];
+
+    push @failsuggestion, [ 'gitattrs',
+ "Warning: Tree has .gitattributes.  See GITATTRIBUTES in dgit(7)." ]
+       if stat_exists '.gitattributes';
+
+    push @failsuggestion, [ 'origs',
  "Maybe orig tarball(s) are not identical to git representation?" ];
 
     if (quiltmode_splitbrain()) {