git-commit: make sure we protect against races.
An earlier commit 8098a178b26dc7a158d129a092a5b78da6d12b72 accidentally lost race protection from git-commit command. This commit reinstates it. When something else updates HEAD pointer while you were editing your commit message, the command would notice and abort the commit. Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano committed
Mar 2, 2006 at 21:13 UTC
b8310152bc5622e4d449e3113ba4edec8fd08087
1 file changed
+2
git-commit.sh
+2
@@ -595,12 +595,14 @@ then
595
PARENTS=$(git-cat-file commit HEAD |
596
sed -n -e '/^$/q' -e 's/^parent /-p /p')
597
fi
598
+ current=$(git-rev-parse --verify HEAD)
599
else
600
if [ -z "$(git-ls-files)" ]; then
601
echo >&2 Nothing to commit
602
exit 1
603
fi
604
PARENTS=""
605
+ current=
606
fi
607
608
{