Skip to content

Commit 6f64a16

Browse files
mhaggergitster
authored andcommitted
do_fetch(): reduce scope of peer_item
Signed-off-by: Michael Haggerty <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 31faeb2 commit 6f64a16

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

builtin/fetch.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,6 @@ static int do_fetch(struct transport *transport,
694694
struct refspec *refs, int ref_count)
695695
{
696696
struct string_list existing_refs = STRING_LIST_INIT_DUP;
697-
struct string_list_item *peer_item = NULL;
698697
struct ref *ref_map;
699698
struct ref *rm;
700699
int autotags = (transport->remote->fetch_tags == 1);
@@ -724,8 +723,9 @@ static int do_fetch(struct transport *transport,
724723

725724
for (rm = ref_map; rm; rm = rm->next) {
726725
if (rm->peer_ref) {
727-
peer_item = string_list_lookup(&existing_refs,
728-
rm->peer_ref->name);
726+
struct string_list_item *peer_item =
727+
string_list_lookup(&existing_refs,
728+
rm->peer_ref->name);
729729
if (peer_item)
730730
hashcpy(rm->peer_ref->old_sha1,
731731
peer_item->util);

0 commit comments

Comments
 (0)