X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;ds=sidebyside;f=git-debrebase;h=c89e598f599a713a9903d7dedd159d840426b7d7;hb=c7244a622fedfc203a935692a6f9e54733494dfc;hp=df5d27e627b6c8093076b61e34dff6b58b834c30;hpb=9b710281a7c7de889942b8a4330b5265bb1e2305;p=dgit.git diff --git a/git-debrebase b/git-debrebase index df5d27e6..c89e598f 100755 --- a/git-debrebase +++ b/git-debrebase @@ -785,13 +785,18 @@ sub update_head_checkout ($$$) { update_head $old, $new, $mrest; } +sub update_head_postlaunder ($$$) { + my ($old, $tip, $reflogmsg) = @_; + update_head $old, $tip, $reflogmsg; + # no tree changes except debian/patches + runcmd @git, qw(rm --quiet --ignore-unmatch -rf debian/patches); +} + sub cmd_launder () { badusage "no arguments to launder allowed" if @ARGV; my $old = get_head(); my ($tip,$breakwater,$last_upstream_merge) = walk $old; - update_head $old, $tip, 'launder'; - # no tree changes except debian/patches - runcmd @git, qw(rm --quiet --ignore-unmatch -rf debian/patches); + update_head_postlaunder $old, $tip, 'launder'; printf "# breakwater tip\n%s\n", $breakwater; printf "# working tip\n%s\n", $tip; printf "# last upstream merge\n%s\n", $last_upstream_merge; @@ -939,15 +944,12 @@ sub cmd_new_upstream_v0 () { if (@newpieces > 1) { # need to make the upstream subtree merge commit - my $us_tree = cmdoutput @git, qw(write-tree); - my @cmd = (@git, qw(commit-tree), $us_tree); - push @cmd, qw(-p), $_ foreach @upstream_merge_parents; - push @cmd, qw(-m), "Combine upstreams for $new_upstream_version"; - push @cmd, qw(-m), - "[git-debrebase new-upstream combine . ". - (join " ", map { $_->{Name} } @newpieces[1..$#newpieces]). - "]"; - $new_upstream = cmdoutput @cmd; + $new_upstream = make_commit \@upstream_merge_parents, + [ "Combine upstreams for $new_upstream_version", + ("[git-debrebase new-upstream combine . ". + (join " ", map { $_->{Name} } @newpieces[1..$#newpieces]). + "]"), + ]; } # $new_upstream is either the single upstream commit, or the @@ -964,7 +966,6 @@ sub cmd_new_upstream_v0 () { # Now we have to add a changelog stanza so the Debian version # is right. - die if unlink "debian"; die $! unless $!==ENOTEMPTY; unlink "debian/changelog" or die $!;