summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2015-07-26 15:21:04 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2015-07-26 15:27:02 +0100
commitb08cca6630e64c51ec712c8acf72397faf7ab700 (patch)
tree7f717ea5867fcf70008f11efbff44cca0e019a29
parentc04a69e8d6a4eeef6ee161a2fb39be3b4d7279d8 (diff)
When source package contains things called .git (even files, and even in subdirectories), remove them. Closes:#793671.
-rw-r--r--debian/changelog2
-rwxr-xr-xdgit16
2 files changed, 17 insertions, 1 deletions
diff --git a/debian/changelog b/debian/changelog
index c3e0a99..1664143 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -31,6 +31,8 @@ dgit (1.1) unstable; urgency=low
* Make warnings fatal in dpkg-repos-admin-debian, dgit-ssh-dispatch
(using setup_sigwarn).
* Make warnings fatal in tstunt/dpkg-parsechangelog (directly).
+ * When source package contains things called .git (even files, and even
+ in subdirectories), remove them. Closes:#793671.
--
diff --git a/dgit b/dgit
index 9dadc8c..687ebe1 100755
--- a/dgit
+++ b/dgit
@@ -1165,7 +1165,21 @@ sub mktree_in_ud_from_only_subdir () {
$dirs[0] =~ m#^([^/]+)/\.$# or die;
my $dir = $1;
changedir $dir;
- fail "source package contains .git directory" if stat_exists '.git';
+
+ my @gitscmd = qw(find -name .git -prune -print0);
+ debugcmd "|",@gitscmd;
+ open GITS, "-|", @gitscmd or failedcmd @gitscmd;
+ {
+ local $/="\0";
+ while (<GITS>) {
+ chomp or die;
+ print STDERR "$us: warning: removing from source package: ",
+ (messagequote $_), "\n";
+ rmtree $_;
+ }
+ }
+ $!=0; $?=0; close GITS or failedcmd @gitscmd;
+
mktree_in_ud_here();
my $format=get_source_format();
if (madformat($format)) {