summaryrefslogtreecommitdiff
path: root/builtin/fetch.c
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2013-05-25 09:08:01 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-05-28 16:25:00 (GMT)
commitb87dbcc89940edbf92cbab381001542a7cac3627 (patch)
tree43132c65d7c9f5908d90b55e51f08e188ecf91ee /builtin/fetch.c
parent219a0f33cae0f164f4353b2171ecd4c08d5b7ced (diff)
downloadgit-b87dbcc89940edbf92cbab381001542a7cac3627.zip
git-b87dbcc89940edbf92cbab381001542a7cac3627.tar.gz
git-b87dbcc89940edbf92cbab381001542a7cac3627.tar.bz2
fetch: make own copies of refnames
Do not retain references to refnames passed to the each_ref_fn callback add_existing(), because their lifetime is not guaranteed. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/fetch.c')
-rw-r--r--builtin/fetch.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/fetch.c b/builtin/fetch.c
index 4b6b1df..f949115 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -590,7 +590,7 @@ static void find_non_local_tags(struct transport *transport,
struct ref **head,
struct ref ***tail)
{
- struct string_list existing_refs = STRING_LIST_INIT_NODUP;
+ struct string_list existing_refs = STRING_LIST_INIT_DUP;
struct string_list remote_refs = STRING_LIST_INIT_NODUP;
const struct ref *ref;
struct string_list_item *item = NULL;
@@ -693,7 +693,7 @@ static int truncate_fetch_head(void)
static int do_fetch(struct transport *transport,
struct refspec *refs, int ref_count)
{
- struct string_list existing_refs = STRING_LIST_INIT_NODUP;
+ struct string_list existing_refs = STRING_LIST_INIT_DUP;
struct string_list_item *peer_item = NULL;
struct ref *ref_map;
struct ref *rm;