summaryrefslogtreecommitdiff
path: root/builtin/fetch.c
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2013-05-25 09:08:15 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-06-02 22:28:46 (GMT)
commit6f64a16faff0189d54cf30854483493574476c6e (patch)
tree6c84ef0d613adc41d97f5b22d6b0fc82c76d9af6 /builtin/fetch.c
parent31faeb2088ef35d0108ad81df3550513d6cec798 (diff)
downloadgit-6f64a16faff0189d54cf30854483493574476c6e.zip
git-6f64a16faff0189d54cf30854483493574476c6e.tar.gz
git-6f64a16faff0189d54cf30854483493574476c6e.tar.bz2
do_fetch(): reduce scope of peer_item
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.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin/fetch.c b/builtin/fetch.c
index f949115..80c6e37 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -694,7 +694,6 @@ static int do_fetch(struct transport *transport,
struct refspec *refs, int ref_count)
{
struct string_list existing_refs = STRING_LIST_INIT_DUP;
- struct string_list_item *peer_item = NULL;
struct ref *ref_map;
struct ref *rm;
int autotags = (transport->remote->fetch_tags == 1);
@@ -724,8 +723,9 @@ static int do_fetch(struct transport *transport,
for (rm = ref_map; rm; rm = rm->next) {
if (rm->peer_ref) {
- peer_item = string_list_lookup(&existing_refs,
- rm->peer_ref->name);
+ struct string_list_item *peer_item =
+ string_list_lookup(&existing_refs,
+ rm->peer_ref->name);
if (peer_item)
hashcpy(rm->peer_ref->old_sha1,
peer_item->util);