Skip to content

Commit 4a27759

Browse files
committed
Merge branch 'bw/remote-get-ref-states-fix'
* bw/remote-get-ref-states-fix: get_ref_states: strdup entries and free util in stale list
2 parents 8678bc0 + 92f676f commit 4a27759

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

builtin-remote.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,9 @@ static int get_ref_states(const struct ref *remote_refs, struct ref_states *stat
272272
die("Could not get fetch map for refspec %s",
273273
states->remote->fetch_refspec[i]);
274274

275-
states->new.strdup_strings = states->tracked.strdup_strings = 1;
275+
states->new.strdup_strings = 1;
276+
states->tracked.strdup_strings = 1;
277+
states->stale.strdup_strings = 1;
276278
for (ref = fetch_map; ref; ref = ref->next) {
277279
unsigned char sha1[20];
278280
if (!ref->peer_ref || read_ref(ref->peer_ref->name, sha1))
@@ -768,7 +770,7 @@ static void clear_push_info(void *util, const char *string)
768770
static void free_remote_ref_states(struct ref_states *states)
769771
{
770772
string_list_clear(&states->new, 0);
771-
string_list_clear(&states->stale, 0);
773+
string_list_clear(&states->stale, 1);
772774
string_list_clear(&states->tracked, 0);
773775
string_list_clear(&states->heads, 0);
774776
string_list_clear_func(&states->push, clear_push_info);

0 commit comments

Comments
 (0)