summaryrefslogtreecommitdiff
path: root/git-rebase--interactive.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-01-26 10:05:22 +0100
committerJunio C Hamano <gitster@pobox.com>2009-01-26 21:23:19 -0800
commita6c7a27691bd8b059d39c9bc71b19fb8e614fa54 (patch)
treec053419f4960e656f292569d0e6c754d7cc396b7 /git-rebase--interactive.sh
parentf7d9d04e3be697989c960881f9b0d50f1ea6a6be (diff)
downloadgit-a6c7a27691bd8b059d39c9bc71b19fb8e614fa54.tar.gz
rebase -i: correctly remember --root flag across --continue
d911d14 (rebase -i: learn to rebase root commit, 2009-01-02) tried to remember the --root flag across a merge conflict in a broken way. Introduce a flag file $DOTEST/rebase-root to fix and clarify. While at it, also make sure $UPSTREAM is always initialized to guard against existing values in the environment. [tr: added tests] Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-rebase--interactive.sh')
-rwxr-xr-xgit-rebase--interactive.sh10
1 files changed, 8 insertions, 2 deletions
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 002929eb09..1438650ae8 100755
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -456,7 +456,7 @@ get_saved_options () {
test -d "$REWRITTEN" && PRESERVE_MERGES=t
test -f "$DOTEST"/strategy && STRATEGY="$(cat "$DOTEST"/strategy)"
test -f "$DOTEST"/verbose && VERBOSE=t
- test ! -s "$DOTEST"/upstream && REBASE_ROOT=t
+ test -f "$DOTEST"/rebase-root && REBASE_ROOT=t
}
while test $# != 0
@@ -586,6 +586,7 @@ first and then run 'git rebase --continue' again."
test -z "$ONTO" && ONTO=$UPSTREAM
shift
else
+ UPSTREAM=
UPSTREAM_ARG=--root
test -z "$ONTO" &&
die "You must specify --onto when using --root"
@@ -612,7 +613,12 @@ first and then run 'git rebase --continue' again."
echo "detached HEAD" > "$DOTEST"/head-name
echo $HEAD > "$DOTEST"/head
- echo $UPSTREAM > "$DOTEST"/upstream
+ case "$REBASE_ROOT" in
+ '')
+ rm -f "$DOTEST"/rebase-root ;;
+ *)
+ : >"$DOTEST"/rebase-root ;;
+ esac
echo $ONTO > "$DOTEST"/onto
test -z "$STRATEGY" || echo "$STRATEGY" > "$DOTEST"/strategy
test t = "$VERBOSE" && : > "$DOTEST"/verbose