From 389526043a277afec9dd8b8dcd9aa97c4b3f2d6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Mon, 14 Jul 2014 20:29:53 +0200 Subject: [PATCH] remote: restrict default branch to branches namespace --- src/remote.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/remote.c b/src/remote.c index 433015f60..8d35fd69a 100644 --- a/src/remote.c +++ b/src/remote.c @@ -1971,6 +1971,9 @@ int git_remote_default_branch(git_buf *out, git_remote *remote) if (git_oid_cmp(head_id, &heads[i]->oid)) continue; + if (git__prefixcmp(heads[i]->name, GIT_REFS_HEADS_DIR)) + continue; + if (!guess) { guess = heads[i]; continue;