diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-10-05 12:30:21 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-10-05 12:30:22 -0700 |
commit | 6560584494a8053431d0c8e90b78d50f71c8055b (patch) | |
tree | 58b98a1dfccd4cce516f15effaa77652cfe7dc05 | |
parent | 96090283e0ba646c599b6a15834bdbb8dd731b4a (diff) | |
parent | 82e0668cde032379095b0581609c73646e9eb92a (diff) | |
download | git-6560584494a8053431d0c8e90b78d50f71c8055b.tar.gz git-6560584494a8053431d0c8e90b78d50f71c8055b.tar.xz |
Merge branch 'jk/rebase-no-autostash'
There was no way to defeat a configured rebase.autostash variable
from the command line, as "git rebase --no-autostash" was missing.
* jk/rebase-no-autostash:
Documentation/git-rebase: fix --no-autostash formatting
rebase: support --no-autostash
-rw-r--r-- | Documentation/git-rebase.txt | 3 | ||||
-rwxr-xr-x | git-rebase.sh | 5 | ||||
-rwxr-xr-x | t/t3420-rebase-autostash.sh | 10 |
3 files changed, 16 insertions, 2 deletions
diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt index ca039546a..72e69fc16 100644 --- a/Documentation/git-rebase.txt +++ b/Documentation/git-rebase.txt @@ -432,7 +432,8 @@ If the '--autosquash' option is enabled by default using the configuration variable `rebase.autoSquash`, this option can be used to override and disable this setting. ---[no-]autostash:: +--autostash:: +--no-autostash:: Automatically create a temporary stash before the operation begins, and apply it after the operation ends. This means that you can run rebase on a dirty worktree. However, use diff --git a/git-rebase.sh b/git-rebase.sh index 1757404bc..af7ba5fd9 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 && |