Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVicent Martí <vicent@github.com>2013-11-11 18:47:15 +0400
committerVicent Martí <vicent@github.com>2013-11-11 18:47:15 +0400
commit6414fd338df89eaa5bd4c64f7ab310fb7d5758bb (patch)
tree4af0ea37b387c791bd89e73edea10e3353c54423 /src/fetchhead.c
parent5e1281f873e7eb5b51569ef33218dd20b69ff707 (diff)
parenta6192d7c98976edb0ce4fd10438ac7a19c283598 (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.c6
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",