summaryrefslogtreecommitdiff
path: root/git-debrebase
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2017-10-25 18:33:36 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2018-06-16 12:25:49 +0100
commit31ca5cbc38b975621d01dd5c5fd5cf6b8f539ee4 (patch)
tree1abf8b17a00793127ae4dd66b491103c0c2e64e4 /git-debrebase
parentc4a29f2072aa18aa1d916c61afd723b38ace7838 (diff)
git-debrebase: bugfixes
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'git-debrebase')
-rwxr-xr-xgit-debrebase12
1 files changed, 10 insertions, 2 deletions
diff --git a/git-debrebase b/git-debrebase
index 139602f..22cdfa6 100755
--- a/git-debrebase
+++ b/git-debrebase
@@ -154,7 +154,8 @@ sub in_workarea ($) {
my ($sub) = @_;
changedir $workarea;
my $r = eval { $sub->(); };
- changedir $maindir;
+ { local $@; changedir $maindir; }
+ die $@ if $@;
}
sub fresh_workarea () {
@@ -627,9 +628,14 @@ sub walk ($;$$) {
my $committer_authline = calculate_committer_authline();
+ printdebug "WALK REBUILD $build ".(scalar @processed)."\n";
+
+ confess "internal error" unless $build eq (pop @processed)->{CommitId};
+
in_workarea sub {
mkdir $rd or $!==EEXIST or die $!;
my $current_method;
+ runcmd @git, qw(read-tree), $build;
foreach my $cl (qw(Debian), (reverse @brw_cl),
{ SpecialMethod => 'RecordBreakwaterTip' },
qw(Upstream), (reverse @upp_cl)) {
@@ -640,6 +646,8 @@ sub walk ($;$$) {
my $method = $cl->{SpecialMethod} // $current_method;
my @parents = ($build);
my $cltree = $cl->{CommitId};
+ printdebug "WALK BUILD ".($cltree//'undef').
+ " $method (rewriting=$rewriting)\n";
if ($method eq 'Debian') {
$read_tree_debian->($cltree);
} elsif ($method eq 'Upstream') {
@@ -685,7 +693,7 @@ sub walk ($;$$) {
};
my $final_check = get_differs $build, $input;
- die sprintf "internal error %#x", $final_check
+ die sprintf "internal error %#x %s %s", $final_check, $build, $input
if $final_check & ~D_PAT_ADD;
return ($build, $breakwater);