summaryrefslogtreecommitdiff
path: root/git-merge.sh
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-02-19 04:51:26 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-02-22 21:14:57 (GMT)
commitd64e6b04291e2313343866a6b206caf13313f1f9 (patch)
tree511478e8e11aa4cdf1a9cedcd5000e4ba9960098 /git-merge.sh
parent589e4f93c7fc31d73da3d0764c71d939c9332442 (diff)
downloadgit-d64e6b04291e2313343866a6b206caf13313f1f9.zip
git-d64e6b04291e2313343866a6b206caf13313f1f9.tar.gz
git-d64e6b04291e2313343866a6b206caf13313f1f9.tar.bz2
Keep Porcelainish from failing by broken ident after making changes.
"empty ident not allowed" error makes commit-tree fail, so we are already safer in that we would not end up with commit objects that have bogus names on the author or committer fields. However, before commit-tree is called there are already changes made to the index file and the working tree. The operation can be resumed after fixing the environment problem, but when this triggers to a newcomer with unusable gecos, the first question becomes "what did I lose and how would I recover". This patch modifies some Porcelainish commands to verify GIT_COMMITTER_IDENT as soon as we know we are going to make some commits before doing much damage to prevent confusion. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-merge.sh')
-rwxr-xr-xgit-merge.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/git-merge.sh b/git-merge.sh
index 74f0761..2b4a603 100755
--- a/git-merge.sh
+++ b/git-merge.sh
@@ -142,6 +142,8 @@ case "$#,$common,$no_commit" in
1,*,)
# We are not doing octopus, not fast forward, and have only
# one common. See if it is really trivial.
+ git var GIT_COMMITTER_IDENT >/dev/null || exit
+
echo "Trying really trivial in-index merge..."
git-update-index --refresh 2>/dev/null
if git-read-tree --trivial -m -u $common $head "$1" &&
@@ -179,6 +181,9 @@ case "$#,$common,$no_commit" in
;;
esac
+# We are going to make a new commit.
+git var GIT_COMMITTER_IDENT >/dev/null || exit
+
case "$use_strategies" in
'')
case "$#" in