Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2011-03-30 00:56:53 +0400
committerJunio C Hamano <gitster@pobox.com>2011-03-30 01:30:54 +0400
commit304cc11c6566cf22e811aa791988c61b6d291973 (patch)
tree6fd82e26abd5019c134016a44b3f93566daca704 /revision.c
parentc063f0a973832784f09a6901eac9501b6f796bde (diff)
notes: refactor display notes extra refs field
There's no need to use an extra pointer, which just ends up leaking memory. The fact that the list is empty tells us the same thing. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'revision.c')
-rw-r--r--revision.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/revision.c b/revision.c
index 5826e5d599..24b89ebfdc 100644
--- a/revision.c
+++ b/revision.c
@@ -1372,11 +1372,9 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
struct strbuf buf = STRBUF_INIT;
revs->show_notes = 1;
revs->show_notes_given = 1;
- if (!revs->notes_opt.extra_notes_refs)
- revs->notes_opt.extra_notes_refs = xcalloc(1, sizeof(struct string_list));
strbuf_addstr(&buf, arg+13);
expand_notes_ref(&buf);
- string_list_append(revs->notes_opt.extra_notes_refs,
+ string_list_append(&revs->notes_opt.extra_notes_refs,
strbuf_detach(&buf, NULL));
} else if (!strcmp(arg, "--no-notes")) {
revs->show_notes = 0;