summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2018-04-22 23:38:00 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2018-06-16 22:40:13 +0100
commit9fe0302b9d3652f4423ab12a4db18145c6b7b13c (patch)
tree21119af07fcdec2e142c49ace6ca7099fde41cd9
parent2e2af845dd1033adebc578773c84d2b6d8227839 (diff)
git-debrebase: Break out make_patches_staged (nfc)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
-rwxr-xr-xgit-debrebase17
1 files changed, 12 insertions, 5 deletions
diff --git a/git-debrebase b/git-debrebase
index ce348e2..52a06d3 100755
--- a/git-debrebase
+++ b/git-debrebase
@@ -1348,6 +1348,17 @@ sub cmd_conclude () {
do_stitch 'quick';
}
+sub make_patches_staged ($$) {
+ my ($bw, $head) = @_;
+ fresh_workarea();
+ in_workarea sub {
+ runcmd @git, qw(checkout -q -b bw), $bw;
+ runcmd @git, qw(checkout -q -b patch-queue/bw), $head;
+ runcmd qw(gbp pq export);
+ runcmd @git, qw(add debian/patches);
+ };
+}
+
sub cmd_convert_from_gbp () {
badusage "needs 1 optional argument, the upstream git rev"
unless @ARGV<=1;
@@ -1422,13 +1433,9 @@ sub cmd_convert_to_gbp () {
my $head = get_head();
my (undef, undef, undef, $ffq, $gdrlast) = ffq_prev_branchinfo();
my ($anchor, $bw) = keycommits $head, 0;
- fresh_workarea();
my $out;
+ make_patches_staged $bw, $head;
in_workarea sub {
- runcmd @git, qw(checkout -q -b bw), $bw;
- runcmd @git, qw(checkout -q -b patch-queue/bw), $head;
- runcmd qw(gbp pq export);
- runcmd @git, qw(add debian/patches);
$out = make_commit ['HEAD'], [
'Commit patch queue (converted from git-debrebase format)',
'[git-debrebase convert-to-gbp: commit patches]',