Only dump heads in head cache

If there is a tag with the same name as a tag, "git rev-parse <name>"
can give the hash of the tag instead of the branch. "git rev-parse
refs/heads/<name>" must be used to make sure we only find branches.
This commit is contained in:
Frej Drejhammar
2014-07-06 14:59:28 +02:00
parent 29e19d696f
commit 2c21922ad1

View File

@@ -131,7 +131,7 @@ cat "$GIT_DIR/$PFX-$SFX_MARKS.old" "$GIT_DIR/$PFX-$SFX_MARKS.tmp" \
# save SHA1s of current heads for incremental imports
# and connectivity (plus sanity checking)
for head in `git branch | sed 's#^..##'` ; do
id="`git rev-parse $head`"
id="`git rev-parse refs/heads/$head`"
echo ":$head $id"
done > "$GIT_DIR/$PFX-$SFX_HEADS"