summaryrefslogtreecommitdiff
path: root/git-pull.sh
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-09-27 18:14:27 -0700
committerJunio C Hamano <junkio@cox.net>2005-09-28 16:42:44 -0700
commitbf7960eb51a26bcf52f27a60bfcf005661266b1e (patch)
treebaeef0ee852f787668eceadd7aefa29b79add7a7 /git-pull.sh
parenta7928f8ec7fb3c368e6086ab48f41e33a22e1b94 (diff)
downloadgit-bf7960eb51a26bcf52f27a60bfcf005661266b1e.tar.gz
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-pull.sh')
-rwxr-xr-xgit-pull.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/git-pull.sh b/git-pull.sh
index 67c7f9562b..1f4a05d09e 100755
--- a/git-pull.sh
+++ b/git-pull.sh
@@ -6,10 +6,10 @@
. git-sh-setup || die "Not a git archive"
-orig_head=$(cat "$GIT_DIR/HEAD") || die "Pulling into a black hole?"
+orig_head=$(git-rev-parse --verify HEAD) || die "Pulling into a black hole?"
git-fetch --update-head-ok "$@" || exit 1
-curr_head=$(cat "$GIT_DIR/HEAD")
+curr_head=$(git-rev-parse --verify HEAD)
if test "$curr_head" != "$orig_head"
then
# The fetch involved updating the current branch.
@@ -40,4 +40,4 @@ case "$merge_head" in
esac
merge_name=$(git-fmt-merge-msg <"$GIT_DIR/FETCH_HEAD")
-git-resolve "$(cat "$GIT_DIR"/HEAD)" $merge_head "$merge_name"
+git-resolve "$curr_head" $merge_head "$merge_name"