提交 7b9a5e27 编写于 作者: J Jay Soffian 提交者: Junio C Hamano

builtin-remote: remove unused code in get_ref_states

get_ref_states() populates the util pointer of the string_list_item's
that it adds to states->new and states->tracked, but nothing ever uses
the pointer, so we can get rid of the extra code.
Signed-off-by: NJay Soffian <jaysoffian@gmail.com>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 88733235
......@@ -250,18 +250,11 @@ static int get_ref_states(const struct ref *ref, struct ref_states *states)
states->new.strdup_strings = states->tracked.strdup_strings = 1;
for (ref = fetch_map; ref; ref = ref->next) {
struct string_list *target = &states->tracked;
unsigned char sha1[20];
void *util = NULL;
if (!ref->peer_ref || read_ref(ref->peer_ref->name, sha1))
target = &states->new;
else {
target = &states->tracked;
if (hashcmp(sha1, ref->new_sha1))
util = &states;
}
string_list_append(abbrev_branch(ref->name), target)->util = util;
string_list_append(abbrev_branch(ref->name), &states->new);
else
string_list_append(abbrev_branch(ref->name), &states->tracked);
}
free_refs(fetch_map);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册