Browse Source

Merge branch 'sg/assume-no-todo-update-in-cherry-pick'

While running "revert" or "cherry-pick --edit" for multiple
commits, a recent regression incorrectly detected "nothing to
commit, working tree clean", instead of replaying the commits,
which has been corrected.

* sg/assume-no-todo-update-in-cherry-pick:
  sequencer: don't re-read todo for revert and cherry-pick
maint
Junio C Hamano 5 years ago
parent
commit
f233c9f455
  1. 2
      sequencer.c
  2. 30
      t/t3429-rebase-edit-todo.sh

2
sequencer.c

@ -3930,7 +3930,7 @@ static int pick_commits(struct repository *r, @@ -3930,7 +3930,7 @@ static int pick_commits(struct repository *r,
item->commit,
arg, item->arg_len,
opts, res, 0);
} else if (check_todo && !res) {
} else if (is_rebase_i(opts) && check_todo && !res) {
struct stat st;

if (stat(get_todo_path(opts), &st)) {

30
t/t3429-rebase-edit-todo.sh

@ -52,4 +52,34 @@ test_expect_success 'todo is re-read after reword and squash' ' @@ -52,4 +52,34 @@ test_expect_success 'todo is re-read after reword and squash' '
test_cmp expected actual
'

test_expect_success 're-reading todo doesnt interfere with revert --edit' '
git reset --hard third &&

git revert --edit third second &&

cat >expect <<-\EOF &&
Revert "second"
Revert "third"
third
second
first
EOF
git log --format="%s" >actual &&
test_cmp expect actual
'

test_expect_success 're-reading todo doesnt interfere with cherry-pick --edit' '
git reset --hard first &&

git cherry-pick --edit second third &&

cat >expect <<-\EOF &&
third
second
first
EOF
git log --format="%s" >actual &&
test_cmp expect actual
'

test_done

Loading…
Cancel
Save