summaryrefslogtreecommitdiff
path: root/remote.c
diff options
context:
space:
mode:
authorLibravatar Michael Haggerty <mhagger@alum.mit.edu>2013-10-30 06:33:01 +0100
committerLibravatar Junio C Hamano <gitster@pobox.com>2013-10-30 14:16:40 -0700
commit049bff8f0ec722dbd4ca9582df7891c920e41165 (patch)
tree407b6f85454bf81e76f28f2df549505a5eb93261 /remote.c
parentfetch --prune: prune only based on explicit refspecs (diff)
downloadtgif-049bff8f0ec722dbd4ca9582df7891c920e41165.tar.xz
query_refspecs(): move some constants out of the loop
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'remote.c')
-rw-r--r--remote.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/remote.c b/remote.c
index a83dc90318..4d45f5dc72 100644
--- a/remote.c
+++ b/remote.c
@@ -825,6 +825,8 @@ static int query_refspecs(struct refspec *refs, int ref_count, struct refspec *q
{
int i;
int find_src = !query->src;
+ const char *needle = find_src ? query->dst : query->src;
+ char **result = find_src ? &query->src : &query->dst;
if (find_src && !query->dst)
return error("query_refspecs: need either src or dst");
@@ -833,8 +835,6 @@ static int query_refspecs(struct refspec *refs, int ref_count, struct refspec *q
struct refspec *refspec = &refs[i];
const char *key = find_src ? refspec->dst : refspec->src;
const char *value = find_src ? refspec->src : refspec->dst;
- const char *needle = find_src ? query->dst : query->src;
- char **result = find_src ? &query->src : &query->dst;
if (!refspec->dst)
continue;