diff options
author | Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> | 2011-02-06 13:43:55 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-02-10 14:08:09 -0800 |
commit | 80ff47957b3a8ae057178a7b1113d171404e938f (patch) | |
tree | 89508cb9b1146dc48c91a6a425d4af5b1b2aff0e /git-rebase.sh | |
parent | 7b37a7c6204998faa80a4bdc1e1ab824bd37d941 (diff) | |
download | git-80ff47957b3a8ae057178a7b1113d171404e938f.tar.gz |
rebase: remember strategy and strategy options
When a rebase is resumed, interactive rebase remembers any merge
strategy passed when the rebase was initated. Make non-interactive
rebase remember any merge strategy as well. Also make non-interactive
rebase remember any merge strategy options.
To be able to resume a rebase that was initiated with an older version
of git (older than this commit), make sure not to expect the saved
option files to exist.
Test case idea taken from Junio's 71fc224 (t3402: test "rebase
-s<strategy> -X<opt>", 2010-11-11).
Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-rebase.sh')
-rwxr-xr-x | git-rebase.sh | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/git-rebase.sh b/git-rebase.sh index 8a36e7a861..f4ad7c1659 100755 --- a/git-rebase.sh +++ b/git-rebase.sh @@ -81,6 +81,9 @@ read_basic_state () { fi && GIT_QUIET=$(cat "$state_dir"/quiet) && test -f "$state_dir"/verbose && verbose=t + test -f "$state_dir"/strategy && strategy="$(cat "$state_dir"/strategy)" + test -f "$state_dir"/strategy_opts && + strategy_opts="$(cat "$state_dir"/strategy_opts)" } write_basic_state () { @@ -89,6 +92,9 @@ write_basic_state () { echo "$orig_head" > "$state_dir"/orig-head && echo "$GIT_QUIET" > "$state_dir"/quiet && test t = "$verbose" && : > "$state_dir"/verbose + test -n "$strategy" && echo "$strategy" > "$state_dir"/strategy + test -n "$strategy_opts" && echo "$strategy_opts" > \ + "$state_dir"/strategy_opts } output () { |