From: Junio C Hamano Date: Thu, 5 Mar 2009 23:41:35 +0000 (-0800) Subject: Merge branch 'js/branch-symref' X-Git-Tag: v1.6.3-rc0~215 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=814742672f765e379f7809eab7650e8ad0a24c35;p=git.git Merge branch 'js/branch-symref' * js/branch-symref: add basic branch display tests branch: clean up repeated strlen Avoid segfault with 'git branch' when the HEAD is detached builtin-branch: improve output when displaying remote branches Conflicts: builtin-branch.c --- 814742672f765e379f7809eab7650e8ad0a24c35 diff --cc builtin-branch.c index 60f70acd1,b15d3517f..14d4b917e --- a/builtin-branch.c +++ b/builtin-branch.c @@@ -323,10 -350,21 +357,21 @@@ static void print_ref_item(struct ref_i c = ' '; if (current) { c = '*'; - color = COLOR_BRANCH_CURRENT; + color = BRANCH_COLOR_CURRENT; } - if (verbose) { + strbuf_addf(&name, "%s%s", prefix, item->name); + if (verbose) + strbuf_addf(&out, "%c %s%-*s%s", c, branch_get_color(color), + maxwidth, name.buf, - branch_get_color(COLOR_BRANCH_RESET)); ++ branch_get_color(BRANCH_COLOR_RESET)); + else + strbuf_addf(&out, "%c %s%s%s", c, branch_get_color(color), - name.buf, branch_get_color(COLOR_BRANCH_RESET)); ++ name.buf, branch_get_color(BRANCH_COLOR_RESET)); + + if (item->dest) + strbuf_addf(&out, " -> %s", item->dest); + else if (verbose) { struct strbuf subject = STRBUF_INIT, stat = STRBUF_INIT; const char *sub = " **** invalid ref ****";