summaryrefslogtreecommitdiff
path: root/git-resolve.sh
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-09-28 01:14:27 (GMT)
committerJunio C Hamano <junkio@cox.net>2005-09-28 23:42:44 (GMT)
commitbf7960eb51a26bcf52f27a60bfcf005661266b1e (patch)
treebaeef0ee852f787668eceadd7aefa29b79add7a7 /git-resolve.sh
parenta7928f8ec7fb3c368e6086ab48f41e33a22e1b94 (diff)
downloadgit-bf7960eb51a26bcf52f27a60bfcf005661266b1e.zip
git-bf7960eb51a26bcf52f27a60bfcf005661266b1e.tar.gz
git-bf7960eb51a26bcf52f27a60bfcf005661266b1e.tar.bz2
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-resolve.sh')
-rwxr-xr-xgit-resolve.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/git-resolve.sh b/git-resolve.sh
index 1f559d8..7d8fb54 100755
--- a/git-resolve.sh
+++ b/git-resolve.sh
@@ -45,7 +45,7 @@ case "$common" in
"$head")
echo "Updating from $head to $merge."
git-read-tree -u -m $head $merge || exit 1
- echo $merge > "$GIT_DIR"/HEAD
+ git-update-ref HEAD "$merge" "$head"
git-diff-tree -p $head $merge | git-apply --stat
dropheads
exit 0
@@ -99,6 +99,6 @@ if [ $? -ne 0 ]; then
fi
result_commit=$(echo "$merge_msg" | git-commit-tree $result_tree -p $head -p $merge)
echo "Committed merge $result_commit"
-echo $result_commit > "$GIT_DIR"/HEAD
+git-update-ref HEAD "$result_commit" "$head"
git-diff-tree -p $head $result_commit | git-apply --stat
dropheads