From: Phillip Wood <phillip.wood@xxxxxxxxxxxxx> This enables the user to always specify --autostage with --continue The tests check that setting rebase.continue.autostage=true results in 'git rebase --continue' autostaging unstaged changes and that '--no-autostage' overrides it. Signed-off-by: Phillip Wood <phillip.wood@xxxxxxxxxxxxx> --- git-rebase.sh | 2 +- t/t3418-rebase-continue.sh | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/git-rebase.sh b/git-rebase.sh index 9ca387349b1cde440c4244de9125446fd35a7b67..632a19079ba1d88092f47121c7a0797af079aaf5 100755 --- a/git-rebase.sh +++ b/git-rebase.sh @@ -70,7 +70,7 @@ merge_dir="$GIT_DIR"/rebase-merge apply_dir="$GIT_DIR"/rebase-apply verbose= diffstat= -autostage=false +autostage=$(git config --bool --get rebase.continue.autostage || echo false) test "$(git config --bool rebase.stat)" = true && diffstat=t autostash="$(git config --bool rebase.autostash || echo false)" fork_point=auto diff --git a/t/t3418-rebase-continue.sh b/t/t3418-rebase-continue.sh index 4e71e5d5c2f26866cd5d32bfea445f899398d6c9..7c2a30a3cd8ba7e33519bd68a3f89e90409169da 100755 --- a/t/t3418-rebase-continue.sh +++ b/t/t3418-rebase-continue.sh @@ -67,6 +67,21 @@ test_autostage () { git reset -- F2 && test_must_fail git rebase --continue --autostage ' + + test_expect_success "rebase.continue.autostage rebase $action works" ' + reset && + test_must_fail git rebase $action --onto master master topic && + echo "Resolved" >F2 && + git -c rebase.continue.autostage=true rebase --continue +' + + test_expect_success "rebase $action --continue --no-autostage works" ' + reset && + test_must_fail git rebase $action --onto master master topic && + echo "Resolved" >F2 && + test_must_fail git -c rebase.continue.autostage=true rebase --continue --no-autostage +' + } test_autostage -- 2.13.3