aboutsummaryrefslogtreecommitdiff
path: root/merge-recursive.c
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2016-10-08 17:38:47 +0200
committerJunio C Hamano <gitster@pobox.com>2016-10-10 11:58:25 -0700
commita94bb683970a111b467a36590ca36e52754ad504 (patch)
treeafb36d917037d10a78c3a5c251f0430d3f4e1e5f /merge-recursive.c
parent39ea59a2570547166834ceeff9ae0c0c05748f35 (diff)
downloadgit-a94bb683970a111b467a36590ca36e52754ad504.tar.gz
git-a94bb683970a111b467a36590ca36e52754ad504.tar.xz
use strbuf_add_unique_abbrev() for adding short hashes, part 3
Call strbuf_add_unique_abbrev() to add abbreviated hashes to strbufs instead of taking detours through find_unique_abbrev() and its static buffer. This is shorter in most cases and a bit more efficient. The changes here are not easily handled by a semantic patch because they involve removing temporary variables and deconstructing format strings for strbuf_addf(). Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'merge-recursive.c')
-rw-r--r--merge-recursive.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/merge-recursive.c b/merge-recursive.c
index d2b191b8c..aa92e30f6 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -202,9 +202,9 @@ static void output_commit_title(struct merge_options *o, struct commit *commit)
strbuf_addf(&o->obuf, "virtual %s\n",
merge_remote_util(commit)->name);
else {
- strbuf_addf(&o->obuf, "%s ",
- find_unique_abbrev(commit->object.oid.hash,
- DEFAULT_ABBREV));
+ strbuf_add_unique_abbrev(&o->obuf, commit->object.oid.hash,
+ DEFAULT_ABBREV);
+ strbuf_addch(&o->obuf, ' ');
if (parse_commit(commit) != 0)
strbuf_addstr(&o->obuf, _("(bad commit)\n"));
else {