From: Junio C Hamano Date: Wed, 26 Mar 2008 08:49:41 +0000 (-0700) Subject: Merge branch 'jc/maint-fetch-regression-1.5.4' X-Git-Tag: v1.5.5-rc2~11 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=660b9c3a4e24ce9a2628f2ec88902e2384d1aade;p=git.git Merge branch 'jc/maint-fetch-regression-1.5.4' * jc/maint-fetch-regression-1.5.4: git-fetch test: test tracking fetch results, not just FETCH_HEAD Fix branches file configuration Tighten refspec processing Fix the wrong output of `git-show v1.3.0~155^2~4` in documentation. --- 660b9c3a4e24ce9a2628f2ec88902e2384d1aade diff --cc remote.c index 04f7521c2,d8a4671e6..08af7f9de --- a/remote.c +++ b/remote.c @@@ -261,14 -213,17 +274,17 @@@ static void read_branches_file(struct r frag = strchr(p, '#'); if (frag) { *(frag++) = '\0'; - branch = xmalloc(strlen(frag) + 12); - strcpy(branch, "refs/heads/"); - strcat(branch, frag); + strbuf_addf(&branch, "refs/heads/%s", frag); + } else + strbuf_addstr(&branch, "refs/heads/master"); + if (!slash) { + strbuf_addf(&branch, ":refs/heads/%s", remote->name); } else { - branch = "refs/heads/master"; + strbuf_reset(&branch); + strbuf_addstr(&branch, "HEAD:"); } - add_url(remote, p); + add_url_alias(remote, p); - add_fetch_refspec(remote, branch); + add_fetch_refspec(remote, strbuf_detach(&branch, 0)); remote->fetch_tags = 1; /* always auto-follow */ }