libgit2/libgit2 — pull request #1010 by ethomson (2012-10-23 00:13:20+00:00)
Title: create FETCH_HEAD specially instead of as a ref file

@carlosmn: I think this addresses your concerns about creation of FETCH_HEAD during fetch. Now if a spec is explicitly fetched (ie, not `refs/heads/*`) then only it is included and it is set as mergeable. Otherwise, we include all branches and tags, setting HEAD to mergeable iff HEAD is a remote tracking branch.

Also, I made creation of FETCH_HEAD optional, since clone would ignore it anyway in favor of trying to determine the remote tracking branch (and clone should not emit FETCH_HEAD anyway.)

Finally, I removed the opaque objects and (hopefully) fixed the formatting issues.

(Sorry, this wasn't intended to be a new pull request, I ended up deleting the old one accidentally.)