summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xgit-commit-script4
-rwxr-xr-xgit-status-script11
2 files changed, 7 insertions, 8 deletions
diff --git a/git-commit-script b/git-commit-script
index e47a090c97..4987e37861 100755
--- a/git-commit-script
+++ b/git-commit-script
@@ -195,8 +195,8 @@ else
fi
if [ "$?" != "0" -a ! -f $GIT_DIR/MERGE_HEAD ]
then
- sed -ne '/^#/p' .editmsg
- rm .editmsg
+ rm -f .editmsg
+ git-status-script
exit 1
fi
case "$no_edit" in
diff --git a/git-status-script b/git-status-script
index 947cc21975..1999a66979 100755
--- a/git-status-script
+++ b/git-status-script
@@ -28,6 +28,11 @@ report () {
[ "$header" ]
}
+branch=`readlink "$GIT_DIR/HEAD"`
+case "$branch" in
+refs/heads/master) ;;
+*) echo "# On branch $branch" ;;
+esac
git-update-cache --refresh >/dev/null 2>&1
git-diff-cache -M --cached HEAD | sed 's/^://' | report "Updated but not checked in" "will commit"
committable="$?"
@@ -37,10 +42,4 @@ then
echo "nothing to commit"
exit 1
fi
-branch=`readlink "$GIT_DIR/HEAD"`
-case "$branch" in
-refs/heads/master) ;;
-*) echo "#
-# On branch $branch" ;;
-esac
exit 0