Skip to content

Commit

Permalink
builtin-remote: remove unused code in get_ref_states
Browse files Browse the repository at this point in the history
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: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Jay Soffian authored and Junio C Hamano committed Feb 27, 2009
1 parent 8873323 commit 7b9a5e2
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions builtin-remote.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 7b9a5e2

Please sign in to comment.