On Thu, Feb 12, 2009 at 3:27 PM, Daniel Barkalow <barkalow@xxxxxxxxxxxx> wrote: > > struct ref *head = locate_head(refs, refs, NULL); > return head ? xstrdup(abbrev_branch(head->name)) : NULL; > > ? No, I don't _think_ so. refs is everything from the remote side (tags, etc). I want to only match those things under refs/heads. I think I have to do something like this (this is more or less what builtin-clone does): struct ref *remote_refs, *mapped_refs = NULL; struct refspec branch_refspec; branch_refspec.force = 0; branch_refspec.src = branch_refspec.dst = "refs/heads"; remote_refs = transport_get_remote_refs(transport); get_fetch_map(remote_refs, branch_refspec, &mapped_refs, 0); head_points_at = locate_head(refs, mapped_refs, NULL); > I'd somehow thought I'd moved locate_head() somewhere common, but it > really ought to be done. I plan to move it into remote.c. > There were periodic discussions of how you find > out when the remote repo changes its HEAD and you might want to do > something locally about it, and we never came up with a specific thing > for git to do, but the facility is probably useful. Thus "git remote set-head -a" is the best I could come up with for setting it to what the remote has. > I have the vague memory, as well, that there's some way for a transport to > report that it actually knows that HEAD is a symref to something in > particular, and so git shouldn't guess. I think for http://, but not for git://, but I'm *far* from an expert in this area. j. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html