summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9d33f7c)
raw | patch | inline | side by side (parent: 9d33f7c)
author | Brandon Casey <drafnel@gmail.com> | |
Thu, 16 Jul 2009 21:25:19 +0000 (16:25 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 16 Jul 2009 22:09:21 +0000 (15:09 -0700) |
When we fall back to a standard for_each_reflog_ent() after failing to find
the nth branch switch (or if we had a short reflog) with the call to
for_each_recent_reflog_ent(), we do not need to free the memory allocated
for our strbuf's since a strbuf_reset() will be performed in
grab_nth_branch_switch() before assigning to the entry.
Plus, the strbuf_release() negates the non-zero hint we initially gave to
strbuf_init() just above these lines.
Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
the nth branch switch (or if we had a short reflog) with the call to
for_each_recent_reflog_ent(), we do not need to free the memory allocated
for our strbuf's since a strbuf_reset() will be performed in
grab_nth_branch_switch() before assigning to the entry.
Plus, the strbuf_release() negates the non-zero hint we initially gave to
strbuf_init() just above these lines.
Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sha1_name.c | patch | blob | history |
diff --git a/sha1_name.c b/sha1_name.c
index 904bcd96a54a1cc33386a56a16d07dce34cbb90b..44bb62d270739a232e87c90c05ce89fcc86bc15b 100644 (file)
--- a/sha1_name.c
+++ b/sha1_name.c
for_each_recent_reflog_ent("HEAD", grab_nth_branch_switch, 40960, &cb);
if (cb.cnt < nth) {
cb.cnt = 0;
- for (i = 0; i < nth; i++)
- strbuf_release(&cb.buf[i]);
for_each_reflog_ent("HEAD", grab_nth_branch_switch, &cb);
}
if (cb.cnt < nth)