diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-10-28 19:01:23 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-10-28 19:01:23 +0300 |
commit | c8fd2201756f9cd10a796311a1b25d7a2ab2a3b9 (patch) | |
tree | 6654ec0ab1a53959fe62fa526445efe71deb0dfb /submodule.c | |
parent | 0582a34f525a95a1c592f111fbf64dd45a4d8e70 (diff) | |
parent | a94bb683970a111b467a36590ca36e52754ad504 (diff) |
Merge branch 'rs/cocci' into maint
Code cleanup.
* rs/cocci:
use strbuf_add_unique_abbrev() for adding short hashes, part 3
remove unnecessary NULL check before free(3)
coccicheck: make transformation for strbuf_addf(sb, "...") more precise
use strbuf_add_unique_abbrev() for adding short hashes, part 2
use strbuf_addstr() instead of strbuf_addf() with "%s", part 2
gitignore: ignore output files of coccicheck make target
use strbuf_addstr() for adding constant strings to a strbuf, part 2
add coccicheck make target
contrib/coccinelle: fix semantic patch for oid_to_hex_r()
Diffstat (limited to 'submodule.c')
-rw-r--r-- | submodule.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/submodule.c b/submodule.c index e8258f061a..9d8d91c207 100644 --- a/submodule.c +++ b/submodule.c @@ -370,11 +370,10 @@ void show_submodule_summary(FILE *f, const char *path, return; } - strbuf_addf(&sb, "%s%sSubmodule %s %s..", line_prefix, meta, path, - find_unique_abbrev(one, DEFAULT_ABBREV)); - if (!fast_backward && !fast_forward) - strbuf_addch(&sb, '.'); - strbuf_addf(&sb, "%s", find_unique_abbrev(two, DEFAULT_ABBREV)); + strbuf_addf(&sb, "%s%sSubmodule %s ", line_prefix, meta, path); + strbuf_add_unique_abbrev(&sb, one, DEFAULT_ABBREV); + strbuf_addstr(&sb, (fast_backward || fast_forward) ? ".." : "..."); + strbuf_add_unique_abbrev(&sb, two, DEFAULT_ABBREV); if (message) strbuf_addf(&sb, " %s%s\n", message, reset); else |