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>
John Keeping committed
Sep 10, 2015 at 23:30 UTC
619e3604288ab54c3694e99746661caf0f2df961
2 files changed
+14
-1
git-rebase.sh
+4
-1
@@ -14,7 +14,7 @@ git-rebase --continue | --abort | --skip | --edit-todo
14
Available options are
15
v,verbose! display a diffstat of what changed upstream
16
q,quiet! be quiet. implies --no-stat
17
-autostash! automatically stash/stash pop before and after
17
+autostash automatically stash/stash pop before and after
18
fork-point use 'merge-base --fork-point' to refine upstream
19
onto=! rebase onto given branch instead of upstream
20
p,preserve-merges! try to recreate merges instead of ignoring them
@@ -292,6 +292,9 @@ do
292
--autostash)
293
autostash=true
294
;;
295
+ --no-autostash)
296
+ autostash=false
297
+ ;;
298
--verbose)
299
verbose=t
300
diffstat=t
t/t3420-rebase-autostash.sh
+10
@@ -37,6 +37,16 @@ testrebase() {
37
type=$1
38
dotest=$2
39
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
+
50
test_expect_success "rebase$type: dirty worktree, non-conflicting rebase" '
51
test_config rebase.autostash true &&
52
git reset --hard &&