Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-02-24 13:21:00 +0300
committerJunio C Hamano <junkio@cox.net>2006-02-24 13:21:00 +0300
commit6d5129ac098e8b9c270efd5fa2695163122a0a46 (patch)
tree95e179100ed9877df930637ff244e9edaa462126
parent7bd1527d2d8c80a6e9a0f8583082a5aee5428c68 (diff)
parent6d28644d691fa3967d24d988d51d863f22bbcc63 (diff)
Merge branch 'fix' into maint
* fix: git-am: do not allow empty commits by mistake.
-rwxr-xr-xgit-am.sh10
1 files changed, 8 insertions, 2 deletions
diff --git a/git-am.sh b/git-am.sh
index 85ecada657..7cc4ae5a30 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -300,7 +300,7 @@ do
} >"$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"
@@ -364,6 +364,12 @@ do
# 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
@@ -374,7 +380,7 @@ do
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.