diff options
author | Vicent Martà <vicent@github.com> | 2013-11-11 18:47:15 +0400 |
---|---|---|
committer | Vicent Martà <vicent@github.com> | 2013-11-11 18:47:15 +0400 |
commit | 6414fd338df89eaa5bd4c64f7ab310fb7d5758bb (patch) | |
tree | 4af0ea37b387c791bd89e73edea10e3353c54423 /src/fetchhead.c | |
parent | 5e1281f873e7eb5b51569ef33218dd20b69ff707 (diff) | |
parent | a6192d7c98976edb0ce4fd10438ac7a19c283598 (diff) |
Merge pull request #1956 from libgit2/cmn/fetch-default-head
Remote revamp (director's cut)
Diffstat (limited to 'src/fetchhead.c')
-rw-r--r-- | src/fetchhead.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/fetchhead.c b/src/fetchhead.c index 9672623ff..67089d13d 100644 --- a/src/fetchhead.c +++ b/src/fetchhead.c @@ -74,6 +74,7 @@ static int fetchhead_ref_write( { char oid[GIT_OID_HEXSZ + 1]; const char *type, *name; + int head = 0; assert(file && fetchhead_ref); @@ -87,11 +88,16 @@ static int fetchhead_ref_write( GIT_REFS_TAGS_DIR) == 0) { type = "tag "; name = fetchhead_ref->ref_name + strlen(GIT_REFS_TAGS_DIR); + } else if (!git__strcmp(fetchhead_ref->ref_name, GIT_HEAD_FILE)) { + head = 1; } else { type = ""; name = fetchhead_ref->ref_name; } + if (head) + return git_filebuf_printf(file, "%s\t\t%s\n", oid, fetchhead_ref->remote_url); + return git_filebuf_printf(file, "%s\t%s\t%s'%s' of %s\n", oid, (fetchhead_ref->is_merge) ? "" : "not-for-merge", |