Add git-symbolic-ref
This adds the counterpart of git-update-ref that lets you read and create "symbolic refs". By default it uses a symbolic link to represent ".git/HEAD -> refs/heads/master", but it can be compiled to use the textfile symbolic ref. The places that did 'readlink .git/HEAD' and 'ln -s refs/heads/blah .git/HEAD' have been converted to use new git-symbolic-ref command, so that they can deal with either implementation. Signed-off-by: Junio C Hamano <junio@twinsun.com>
This commit is contained in:

committed by
Junio C Hamano

parent
a876ed83be
commit
8098a178b2
@ -71,7 +71,8 @@ if [ "$?" -eq 0 ]; then
|
||||
echo $new > "$GIT_DIR/refs/heads/$newbranch"
|
||||
branch="$newbranch"
|
||||
fi
|
||||
[ "$branch" ] && ln -sf "refs/heads/$branch" "$GIT_DIR/HEAD"
|
||||
[ "$branch" ] &&
|
||||
GIT_DIR="$GIT_DIR" git-symbolic-ref HEAD "refs/heads/$branch"
|
||||
rm -f "$GIT_DIR/MERGE_HEAD"
|
||||
else
|
||||
exit 1
|
||||
|
Reference in New Issue
Block a user