summaryrefslogtreecommitdiff
path: root/builtin/show-ref.c
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2013-05-25 09:08:22 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-06-02 22:28:47 (GMT)
commit66ce0366285f73c340f04a21b3d8be898d7bf5a7 (patch)
tree9228243d986d6bd712662fcc02a1bdbd418f6031 /builtin/show-ref.c
parent8c46bf904fe95105faaa1823332c91d2802182c2 (diff)
downloadgit-66ce0366285f73c340f04a21b3d8be898d7bf5a7.zip
git-66ce0366285f73c340f04a21b3d8be898d7bf5a7.tar.gz
git-66ce0366285f73c340f04a21b3d8be898d7bf5a7.tar.bz2
exclude_existing(): set existing_refs.strdup_strings
The each_ref_fn add_existing() adds refnames to the existing_refs list. But the lifetimes of these refnames is not guaranteed by the refs API, so configure the string_list to make copies as it adds them. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/show-ref.c')
-rw-r--r--builtin/show-ref.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/show-ref.c b/builtin/show-ref.c
index 8d9b76a..4a0310d 100644
--- a/builtin/show-ref.c
+++ b/builtin/show-ref.c
@@ -103,7 +103,7 @@ static int add_existing(const char *refname, const unsigned char *sha1, int flag
*/
static int exclude_existing(const char *match)
{
- static struct string_list existing_refs = STRING_LIST_INIT_NODUP;
+ static struct string_list existing_refs = STRING_LIST_INIT_DUP;
char buf[1024];
int matchlen = match ? strlen(match) : 0;