X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;ds=sidebyside;f=git-debrebase;h=8e347f15843b71deb7ad9e0450ce37478a2c8b93;hb=397f40c5e2d471582a688474df4aa1c9ed0f7a54;hp=3be444b935e4af4e02a2e50e2e61cbf0230e4b81;hpb=d74ea48e54d4bf0902bfe2364cde833d27e40ad8;p=dgit.git diff --git a/git-debrebase b/git-debrebase index 3be444b9..8e347f15 100755 --- a/git-debrebase +++ b/git-debrebase @@ -196,6 +196,8 @@ sub get_tree ($;$$) { return () if $type eq 'missing'; } + confess "get_tree needs object not $x ?" unless $x =~ m{^[0-9a-f]+\:}; + our (@get_tree_memo, %get_tree_memo); my $memo = $get_tree_memo{$x}; return @$memo if $memo; @@ -426,6 +428,11 @@ sub any_snags () { return $snags_forced || $snags_tripped; } +sub record_gdrlast ($$) { + my ($gdrlast, $newvalue) = @_; + push @deferred_updates, "update $gdrlast $newvalue $git_null_obj"; +} + sub gbp_pq_export ($$$) { my ($bname, $base, $tip) = @_; # must be run in a workarea. $bname and patch-queue/$bname @@ -1879,8 +1886,7 @@ sub stitch ($$$$$) { # ffq-prev is ahead of us, and the only tree changes it has # are possibly addition of things in debian/patches/. # Just wind forwards rather than making a pointless pseudomerge. - push @deferred_updates, - "update $gdrlast $ffq_prev_commitish $git_null_obj"; + record_gdrlast $gdrlast, $ffq_prev_commitish; update_head_checkout $old_head, $ffq_prev_commitish, "stitch (fast forward)"; return; @@ -1893,7 +1899,7 @@ sub stitch ($$$$$) { 'Declare fast forward / record previous work', "[git-debrebase pseudomerge: $prose]", ]; - push @deferred_updates, "update $gdrlast $new_head $git_null_obj"; + record_gdrlast $gdrlast, $new_head; update_head $old_head, $new_head, "stitch: $prose"; }