summaryrefslogtreecommitdiff
path: root/git-debrebase
diff options
context:
space:
mode:
Diffstat (limited to 'git-debrebase')
-rwxr-xr-xgit-debrebase24
1 files changed, 16 insertions, 8 deletions
diff --git a/git-debrebase b/git-debrebase
index 8e347f1..2e0882d 100755
--- a/git-debrebase
+++ b/git-debrebase
@@ -2409,6 +2409,18 @@ sub check_series_has_all_patches ($) {
}
}
+sub begin_convert_from () {
+ my $head = get_head();
+ return ($head, undef);
+}
+
+sub complete_convert_from ($$$$) {
+ my ($old_head, $new_head, $gi, $mrest) = @_;
+ ffq_check $new_head;
+ snags_maybe_bail();
+ update_head_checkout $old_head, $new_head, $mrest;
+}
+
sub cmd_convert_from_gbp () {
badusage "want only 1 optional argument, the upstream git commitish"
unless @ARGV<=1;
@@ -2423,7 +2435,7 @@ sub cmd_convert_from_gbp () {
my $upstream =
resolve_upstream_version($upstream_spec, $upstream_version);
- my $old_head = get_head();
+ my ($old_head, $gdrlastinfo) = begin_convert_from();
my $upsdiff = get_differs $upstream, $old_head;
if ($upsdiff & D_UPS) {
@@ -2537,9 +2549,7 @@ END
}
};
- ffq_check $work;
- snags_maybe_bail();
- update_head_checkout $old_head, $work, 'convert-from-gbp';
+ complete_convert_from $old_head, $work, $gdrlastinfo, 'convert-from-gbp';
print <<END or die $!;
git-debrebase: converted from patched-unapplied (gbp) branch format, OK
END
@@ -2599,7 +2609,7 @@ sub cmd_convert_from_dgit_view () {
};
}
- my $head = get_head();
+ my ($head, $gdrlastinfo) = begin_convert_from();
if (!$always) {
my $troubles = 0;
@@ -2755,9 +2765,7 @@ END
printf STDERR "Yes, will base new branch on %s\n", $result->{Source};
- ffq_check $result->{Result};
- snags_maybe_bail();
- update_head_checkout $head, $result->{Result},
+ complete_convert_from $head, $result->{Result}, $gdrlastinfo,
'convert-from-dgit-view';
}