From bf7960eb51a26bcf52f27a60bfcf005661266b1e Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 27 Sep 2005 18:14:27 -0700 Subject: 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 --- git-pull.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'git-pull.sh') diff --git a/git-pull.sh b/git-pull.sh index 67c7f9562..1f4a05d09 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" -- cgit v1.2.1