summaryrefslogtreecommitdiff
path: root/git-rebase--interactive.sh
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2009-01-27 11:42:31 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-01-28 22:54:58 (GMT)
commit94c88edef7a69299e12248b910752f1fc26f12d6 (patch)
treea6c9940ce036280e0e5a0db16f32c7d0c164041e /git-rebase--interactive.sh
parent967476966513564e9c28847f7a974b8af5093493 (diff)
downloadgit-94c88edef7a69299e12248b910752f1fc26f12d6.zip
git-94c88edef7a69299e12248b910752f1fc26f12d6.tar.gz
git-94c88edef7a69299e12248b910752f1fc26f12d6.tar.bz2
Fix submodule squashing into unrelated commit
Actually, I think the issue is pretty independent of submodules; when "git commit" gets an empty parameter, it misinterprets it as a file. So avoid passing an empty parameter to "git commit". Actually, this is a nice cleanup, as MSG_FILE and EDIT_COMMIT were mutually exclusive; use one variable instead Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-rebase--interactive.sh')
-rwxr-xr-xgit-rebase--interactive.sh9
1 files changed, 4 insertions, 5 deletions
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 8ed2244..1ceb57a 100755
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -360,17 +360,15 @@ do_next () {
pick_one -n $sha1 || failed=t
case "$(peek_next_command)" in
squash|s)
- EDIT_COMMIT=
USE_OUTPUT=output
MSG_OPT=-F
- MSG_FILE="$MSG"
+ EDIT_OR_FILE="$MSG"
cp "$MSG" "$SQUASH_MSG"
;;
*)
- EDIT_COMMIT=-e
USE_OUTPUT=
MSG_OPT=
- MSG_FILE=
+ EDIT_OR_FILE=-e
rm -f "$SQUASH_MSG" || exit
cp "$MSG" "$GIT_DIR"/SQUASH_MSG
rm -f "$GIT_DIR"/MERGE_MSG || exit
@@ -384,7 +382,8 @@ do_next () {
GIT_AUTHOR_NAME="$GIT_AUTHOR_NAME" \
GIT_AUTHOR_EMAIL="$GIT_AUTHOR_EMAIL" \
GIT_AUTHOR_DATE="$GIT_AUTHOR_DATE" \
- $USE_OUTPUT git commit --no-verify $MSG_OPT "$MSG_FILE" $EDIT_COMMIT || failed=t
+ $USE_OUTPUT git commit --no-verify \
+ $MSG_OPT "$EDIT_OR_FILE" || failed=t
fi
if test $failed = t
then