summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 183bdb2)
raw | patch | inline | side by side (parent: 183bdb2)
author | Junio C Hamano <junkio@cox.net> | |
Fri, 24 Feb 2006 06:14:47 +0000 (22:14 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Fri, 24 Feb 2006 06:14:47 +0000 (22:14 -0800) |
Running "git-am --resolved" without doing anything can create an empty
commit. Prevent it.
Thanks for Eric W. Biederman for spotting this.
Signed-off-by: Junio C Hamano <junkio@cox.net>
commit. Prevent it.
Thanks for Eric W. Biederman for spotting this.
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-am.sh | patch | blob | history |
diff --git a/git-am.sh b/git-am.sh
index 85ecada657d21aba4b54034dbaf869f8387d7d02..7cc4ae5a30ed3a56cff9def63e351f957cad6666 100755 (executable)
--- a/git-am.sh
+++ b/git-am.sh
} >"$dotest/final-commit"
;;
*)
- case "$resolved,$interactive" in
+ case "$resolved$interactive" in
tt)
# This is used only for interactive view option.
git-diff-index -p --cached HEAD >"$dotest/patch"
# trust what the user has in the index file and the
# working tree.
resolved=
+ changed="$(git-diff-index --cached --name-only HEAD)"
+ if test '' = "$changed"
+ then
+ echo "No changes - did you forget update-index?"
+ stop_here $this
+ fi
apply_status=0
;;
esac
then
# Applying the patch to an earlier tree and merging the
# result may have produced the same tree as ours.
- changed="$(git-diff-index --cached --name-only -z HEAD)"
+ changed="$(git-diff-index --cached --name-only HEAD)"
if test '' = "$changed"
then
echo No changes -- Patch already applied.