rebase -m: remember allow_rerere_autoupdate option
If '--[no-]allow_rerere_autoupdate' is passed when 'git rebase -m' is called and a merge conflict occurs, the flag will be forgotten for the rest of the rebase process. Make rebase remember it by saving the value. Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Martin von Zweigbergk committed
Feb 6, 2011 at 13:43 UTC
b3e4847e50cf0ab3da4ad9664a5e4382e778ebd5
2 files changed
+25
git-rebase.sh
+4
@@ -84,6 +84,8 @@ read_basic_state () {
84
test -f "$state_dir"/strategy && strategy="$(cat "$state_dir"/strategy)"
85
test -f "$state_dir"/strategy_opts &&
86
strategy_opts="$(cat "$state_dir"/strategy_opts)"
87
+ test -f "$state_dir"/allow_rerere_autoupdate &&
88
+ allow_rerere_autoupdate="$(cat "$state_dir"/allow_rerere_autoupdate)"
89
}
90
91
write_basic_state () {
@@ -95,6 +97,8 @@ write_basic_state () {
97
test -n "$strategy" && echo "$strategy" > "$state_dir"/strategy
98
test -n "$strategy_opts" && echo "$strategy_opts" > \
99
"$state_dir"/strategy_opts
100
+ test -n "$allow_rerere_autoupdate" && echo "$allow_rerere_autoupdate" > \
101
+ "$state_dir"/allow_rerere_autoupdate
102
}
103
104
output () {
t/t3418-rebase-continue.sh
+21
@@ -74,4 +74,25 @@ test_expect_success 'rebase --continue remembers merge strategy and options' '
74
test -f funny.was.run
75
'
76
77
+test_expect_success 'rebase --continue remembers --rerere-autoupdate' '
78
+ rm -fr .git/rebase-* &&
79
+ git reset --hard commit-new-file-F3-on-topic-branch &&
80
+ git checkout master
81
+ test_commit "commit-new-file-F3" F3 3 &&
82
+ git config rerere.enabled true &&
83
+ test_must_fail git rebase -m master topic &&
84
+ echo "Resolved" >F2 &&
85
+ git add F2 &&
86
+ test_must_fail git rebase --continue &&
87
+ echo "Resolved" >F3 &&
88
+ git add F3 &&
89
+ git rebase --continue &&
90
+ git reset --hard topic@{1} &&
91
+ test_must_fail git rebase -m --rerere-autoupdate master &&
92
+ test "$(cat F2)" = "Resolved" &&
93
+ test_must_fail git rebase --continue &&
94
+ test "$(cat F3)" = "Resolved" &&
95
+ git rebase --continue
96
+'
97
+
98
test_done