Skip to content

Commit c036a14

Browse files
committed
Merge branch 'vn/rebase-with-cherry-pick-authorship'
"git cherry-pick" invoked during "git rebase -i" session lost the authorship information, which has been corrected. * vn/rebase-with-cherry-pick-authorship: sequencer: unset GIT_CHERRY_PICK_HELP for 'exec' commands
2 parents 09e0aa6 + e4301f7 commit c036a14

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

sequencer.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3641,6 +3641,7 @@ static int do_exec(struct repository *r, const char *command_line)
36413641
fprintf(stderr, _("Executing: %s\n"), command_line);
36423642
cmd.use_shell = 1;
36433643
strvec_push(&cmd.args, command_line);
3644+
strvec_push(&cmd.env, "GIT_CHERRY_PICK_HELP");
36443645
status = run_command(&cmd);
36453646

36463647
/* force re-reading of the cache */

t/t3404-rebase-interactive.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,18 @@ test_expect_success 'rebase -i with the exec command checks tree cleanness' '
153153
git rebase --continue
154154
'
155155

156+
test_expect_success 'cherry-pick works with rebase --exec' '
157+
test_when_finished "git cherry-pick --abort; \
158+
git rebase --abort; \
159+
git checkout primary" &&
160+
echo "exec git cherry-pick G" >todo &&
161+
(
162+
set_replace_editor todo &&
163+
test_must_fail git rebase -i D D
164+
) &&
165+
test_cmp_rev G CHERRY_PICK_HEAD
166+
'
167+
156168
test_expect_success 'rebase -x with empty command fails' '
157169
test_when_finished "git rebase --abort ||:" &&
158170
test_must_fail env git rebase -x "" @ 2>actual &&

0 commit comments

Comments
 (0)