X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=dgit;h=149345dd23073630b932e9953d955b072750d898;hb=5307140c7bb2a71334522ed0d88e78efcaa210be;hp=97557ce1c3e1c3a4042160a8c2ab99359184330b;hpb=9dd8836fb53b8d37db646b28d6ae94b052130736;p=dgit.git diff --git a/dgit b/dgit index 97557ce1..149345dd 100755 --- a/dgit +++ b/dgit @@ -176,6 +176,7 @@ autoflush STDOUT 1; our $supplementary_message = ''; our $split_brain = 0; +our $do_split_brain = 0; END { local ($@, $?); @@ -4492,6 +4493,7 @@ END if (madformat_wantfixup($format)) { # user might have not used dgit build, so maybe do this now: if (quiltmode_splitbrain()) { + $do_split_brain = 1; changedir $playground; quilt_make_fake_dsc($upstreamversion); my $cachekey; @@ -4501,17 +4503,22 @@ END "--quilt=%s but no cached dgit view: perhaps HEAD changed since dgit build[-source] ?", $quilt_mode; - $split_brain = 1; - $dgithead = splitbrain_pseudomerge($clogp, - $actualhead, $dgithead, - $archive_hash); - $maintviewhead = $actualhead; - changedir $maindir; - prep_ud(); # so _only_subdir() works, below - } else { + } + if (!$do_split_brain) { + # In split brain mode, do not attempt to incorporate dirty + # stuff from the user's working tree. That would be mad. commit_quilty_patch(); } } + if ($do_split_brain) { + $split_brain = 1; + $dgithead = splitbrain_pseudomerge($clogp, + $actualhead, $dgithead, + $archive_hash); + $maintviewhead = $actualhead; + changedir $maindir; + prep_ud(); # so _only_subdir() works, below + } if (defined $overwrite_version && !defined $maintviewhead && $archive_hash) { @@ -5393,9 +5400,7 @@ sub quiltify_splitbrain ($$$$$$$) { local $ENV{GIT_AUTHOR_EMAIL} = $authline[1]; local $ENV{GIT_AUTHOR_DATE} = $authline[2]; - die if $split_brain; - runcmd @git, qw(checkout -q -b dgit-view); - $split_brain = 1; + die unless $do_split_brain; my $fulldiffhint = sub { my ($x,$y) = @_; @@ -5783,12 +5788,7 @@ sub build_maybe_quilt_fixup () { check_for_vendor_patches(); - if (quiltmode_splitbrain) { - fail <