author | Junio C Hamano <gitster@pobox.com> | |
Thu, 5 Mar 2009 23:41:35 +0000 (15:41 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 5 Mar 2009 23:41:35 +0000 (15:41 -0800) |
* 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
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
1 | 2 | |||
---|---|---|---|---|
builtin-branch.c | patch | | diff1 | | diff2 | | blob | history |
diff --cc builtin-branch.c
index 60f70acd144f95c9502f5d8c370fea20d1d6b010,b15d3517f338477e6a7014cf4373914e2c962d64..14d4b917e5bb929f40efd3fc5e010cec5d3507de
--- 1/builtin-branch.c
--- 2/builtin-branch.c
+++ b/builtin-branch.c
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 ****";