X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=blobdiff_plain;f=dgit;h=687ebe14337ce29c8cab701e0b69393875f103f7;hp=9dadc8cce98274eb96944e60b01df5d26a491a95;hb=b08cca6630e64c51ec712c8acf72397faf7ab700;hpb=c04a69e8d6a4eeef6ee161a2fb39be3b4d7279d8 diff --git a/dgit b/dgit index 9dadc8cc..687ebe14 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 () { + 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)) {