chiark / gitweb /
Better error when source package contains .git. Closes: #720555.
[dgit.git] / dgit
diff --git a/dgit b/dgit
index 2d47dbfebcf201ce6e465e449de15e38e96ccf39..645528f63c6f7f22dfc59a103fbb0e0452b9dd4d 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -488,7 +488,7 @@ sub mktree_in_ud_from_only_subdir () {
     $dirs[0] =~ m#^([^/]+)/\.$# or die;
     my $dir = $1;
     chdir $dir or die "$dir $!";
-    die if stat '.git';
+    fail "source package contains .git directory" if stat '.git';
     die $! unless $!==&ENOENT;
     runcmd qw(git init -q);
     rmtree('.git/objects');