diff options
author | John Keeping <john@keeping.me.uk> | 2015-09-10 23:30:51 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-09-10 17:42:01 -0700 |
commit | 619e3604288ab54c3694e99746661caf0f2df961 (patch) | |
tree | e8b9134a571a3021577a5b59480c39692d2c4f20 | |
parent | 441c4a40173fe1ee8a5c0094e587dfc47e2a6460 (diff) | |
download | git-619e3604288ab54c3694e99746661caf0f2df961.tar.gz git-619e3604288ab54c3694e99746661caf0f2df961.tar.xz |
rebase: support --no-autostash
This is documented as an option but we don't actually accept it.
Support it so that it is possible to override the "rebase.autostash"
config variable.
Reported-by: Daniel Hahler <genml+git-2014@thequod.de>
Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-x | git-rebase.sh | 5 | ||||
-rwxr-xr-x | t/t3420-rebase-autostash.sh | 10 |
2 files changed, 14 insertions, 1 deletions
diff --git a/git-rebase.sh b/git-rebase.sh index 55da9db81..95a45938a 100755 --- a/git-rebase.sh +++ b/git-rebase.sh @@ -14,7 +14,7 @@ git-rebase --continue | --abort | --skip | --edit-todo Available options are v,verbose! display a diffstat of what changed upstream q,quiet! be quiet. implies --no-stat -autostash! automatically stash/stash pop before and after +autostash automatically stash/stash pop before and after fork-point use 'merge-base --fork-point' to refine upstream onto=! rebase onto given branch instead of upstream p,preserve-merges! try to recreate merges instead of ignoring them @@ -292,6 +292,9 @@ do --autostash) autostash=true ;; + --no-autostash) + autostash=false + ;; --verbose) verbose=t diffstat=t diff --git a/t/t3420-rebase-autostash.sh b/t/t3420-rebase-autostash.sh index d783f03d3..944154b2e 100755 --- a/t/t3420-rebase-autostash.sh +++ b/t/t3420-rebase-autostash.sh @@ -37,6 +37,16 @@ testrebase() { type=$1 dotest=$2 + test_expect_success "rebase$type: dirty worktree, --no-autostash" ' + test_config rebase.autostash true && + git reset --hard && + git checkout -b rebased-feature-branch feature-branch && + test_when_finished git branch -D rebased-feature-branch && + test_when_finished git checkout feature-branch && + echo dirty >>file3 && + test_must_fail git rebase$type --no-autostash unrelated-onto-branch + ' + test_expect_success "rebase$type: dirty worktree, non-conflicting rebase" ' test_config rebase.autostash true && git reset --hard && |