summaryrefslogtreecommitdiff
path: root/dgit
diff options
context:
space:
mode:
Diffstat (limited to 'dgit')
-rwxr-xr-xdgit16
1 files changed, 15 insertions, 1 deletions
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)) {