File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -434,7 +434,8 @@ If the '--autosquash' option is enabled by default using the
434434configuration variable `rebase.autoSquash`, this option can be
435435used to override and disable this setting.
436436
437- --[no-]autostash::
437+ --autostash::
438+ --no-autostash::
438439 Automatically create a temporary stash before the operation
439440 begins, and apply it after the operation ends. This means
440441 that you can run rebase on a dirty worktree. However, use
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ git-rebase --continue | --abort | --skip | --edit-todo
1414 Available options are
1515v,verbose! display a diffstat of what changed upstream
1616q,quiet! be quiet. implies --no-stat
17- autostash! automatically stash/stash pop before and after
17+ autostash automatically stash/stash pop before and after
1818fork-point use 'merge-base --fork-point' to refine upstream
1919onto=! rebase onto given branch instead of upstream
2020p,preserve-merges! try to recreate merges instead of ignoring them
292292 --autostash)
293293 autostash=true
294294 ;;
295+ --no-autostash)
296+ autostash=false
297+ ;;
295298 --verbose)
296299 verbose=t
297300 diffstat=t
Original file line number Diff line number Diff line change @@ -37,6 +37,16 @@ testrebase() {
3737 type=$1
3838 dotest=$2
3939
40+ test_expect_success " rebase$type : dirty worktree, --no-autostash" '
41+ test_config rebase.autostash true &&
42+ git reset --hard &&
43+ git checkout -b rebased-feature-branch feature-branch &&
44+ test_when_finished git branch -D rebased-feature-branch &&
45+ test_when_finished git checkout feature-branch &&
46+ echo dirty >>file3 &&
47+ test_must_fail git rebase$type --no-autostash unrelated-onto-branch
48+ '
49+
4050 test_expect_success " rebase$type : dirty worktree, non-conflicting rebase" '
4151 test_config rebase.autostash true &&
4252 git reset --hard &&
You can’t perform that action at this time.
0 commit comments