mirror of
https://github.com/git/git
synced 2024-08-25 10:45:59 +00:00
Merge branch 'en/rebase-x-fix'
"git rebase -x" added an unnecessary 'exec' instructions before 'noop', which has been corrected. * en/rebase-x-fix: sequencer: avoid adding exec commands for non-commit creating commands
This commit is contained in:
commit
3e1dbfa135
|
@ -5502,7 +5502,7 @@ static void todo_list_add_exec_commands(struct todo_list *todo_list,
|
|||
}
|
||||
|
||||
/* insert or append final <commands> */
|
||||
if (insert || nr == todo_list->nr) {
|
||||
if (insert) {
|
||||
ALLOC_GROW(items, nr + commands->nr, alloc);
|
||||
COPY_ARRAY(items + nr, base_items, commands->nr);
|
||||
nr += commands->nr;
|
||||
|
|
|
@ -13,10 +13,15 @@ test_expect_success 'setup' '
|
|||
|
||||
test_expect_success 'rebase exec modifies rebase-todo' '
|
||||
todo=.git/rebase-merge/git-rebase-todo &&
|
||||
git rebase HEAD -x "echo exec touch F >>$todo" &&
|
||||
git rebase HEAD~1 -x "echo exec touch F >>$todo" &&
|
||||
test -e F
|
||||
'
|
||||
|
||||
test_expect_success 'rebase exec with an empty list does not exec anything' '
|
||||
git rebase HEAD -x "true" 2>output &&
|
||||
! grep "Executing: true" output
|
||||
'
|
||||
|
||||
test_expect_success 'loose object cache vs re-reading todo list' '
|
||||
GIT_REBASE_TODO=.git/rebase-merge/git-rebase-todo &&
|
||||
export GIT_REBASE_TODO &&
|
||||
|
|
Loading…
Reference in a new issue