summaryrefslogtreecommitdiff
path: root/git-rebase--interactive.sh
diff options
context:
space:
mode:
authorMartin von Zweigbergk <martin.von.zweigbergk@gmail.com>2011-02-06 13:43:38 -0500
committerJunio C Hamano <gitster@pobox.com>2011-02-10 14:08:08 -0800
commit9765b6abeb00145df18cde6b76a9b1fa97eeef53 (patch)
tree1adbbef074725b69989a9dcba079bce1a225582c /git-rebase--interactive.sh
parent6bb4e485cff86d87b5265f26d6138357444e5eb9 (diff)
downloadgit-9765b6abeb00145df18cde6b76a9b1fa97eeef53.tar.gz
rebase: align variable content
Make sure to interpret variables with the same name in the same way in git-rebase.sh and git-rebase--interactive.sh. This will make it easier to factor out code from git-rebase.sh to git-rebase--interactive and export the variables. 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--interactive.sh')
-rwxr-xr-xgit-rebase--interactive.sh16
1 files changed, 11 insertions, 5 deletions
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 2fa348bae8..8b0d7b0ac1 100755
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -339,7 +339,8 @@ pick_one_preserving_merges () {
# No point in merging the first parent, that's HEAD
new_parents=${new_parents# $first_parent}
if ! do_with_author output \
- git merge $strategy -m "$msg_content" $new_parents
+ git merge ${strategy:+-s $strategy} -m \
+ "$msg_content" $new_parents
then
printf "%s\n" "$msg_content" > "$GIT_DIR"/MERGE_MSG
die_with_patch $sha1 "Error redoing merge $sha1"
@@ -827,11 +828,11 @@ first and then run 'git rebase --continue' again."
-s)
case "$#,$1" in
*,*=*)
- strategy="-s "$(expr "z$1" : 'z-[^=]*=\(.*\)') ;;
+ strategy=$(expr "z$1" : 'z-[^=]*=\(.*\)') ;;
1,*)
usage ;;
*)
- strategy="-s $2"
+ strategy="$2"
shift ;;
esac
;;
@@ -860,9 +861,9 @@ first and then run 'git rebase --continue' again."
autosquash=
;;
--onto)
+ test 2 -le "$#" || usage
+ onto="$2"
shift
- onto=$(parse_onto "$1") ||
- die "Does not point to a valid commit: $1"
;;
--)
shift
@@ -872,6 +873,11 @@ first and then run 'git rebase --continue' again."
shift
done
+if test -n "$onto"
+then
+ onto=$(parse_onto "$onto") || die "Does not point to a valid commit: $1"
+fi
+
test -z "$rebase_root" -a $# -ge 1 -a $# -le 2 ||
test ! -z "$rebase_root" -a $# -le 1 || usage
test -d "$dotest" &&