diff options
author | Junio C Hamano <junkio@cox.net> | 2005-09-27 18:14:27 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2005-09-28 16:42:44 -0700 |
commit | bf7960eb51a26bcf52f27a60bfcf005661266b1e (patch) | |
tree | baeef0ee852f787668eceadd7aefa29b79add7a7 /git-applypatch.sh | |
parent | [PATCH] Make some needlessly global stuff static (diff) | |
download | tgif-bf7960eb51a26bcf52f27a60bfcf005661266b1e.tar.xz |
Use git-update-ref in scripts.
This uses the git-update-ref command in scripts for safer updates.
Also places where we used to read HEAD ref by using "cat" were fixed
to use git-rev-parse. This will matter when we start using symbolic
references.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-applypatch.sh')
-rwxr-xr-x | git-applypatch.sh | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/git-applypatch.sh b/git-applypatch.sh index fd594ed4e4..9f5a45bb2b 100755 --- a/git-applypatch.sh +++ b/git-applypatch.sh @@ -108,9 +108,10 @@ fi tree=$(git-write-tree) || exit 1 echo Wrote tree $tree -commit=$(git-commit-tree $tree -p $(cat "$GIT_DIR"/HEAD) < "$final") || exit 1 +parent=$(git-rev-parse --verify HEAD) && +commit=$(git-commit-tree $tree -p $parent <"$final") || exit 1 echo Committed: $commit -echo $commit > "$GIT_DIR"/HEAD +git-update-ref HEAD $commit $parent || exit if test -x "$GIT_DIR"/hooks/post-applypatch then |