Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
query_refspecs(): move some constants out of the loop
author
Michael Haggerty
<mhagger@alum.mit.edu>
Wed, 30 Oct 2013 05:33:01 +0000
(06:33 +0100)
committer
Junio C Hamano
<gitster@pobox.com>
Wed, 30 Oct 2013 21:16:40 +0000
(14:16 -0700)
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
remote.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
0838bf4
)
diff --git
a/remote.c
b/remote.c
index a83dc90318d61a2fb94b2bf1572fbce3e8fd15f4..4d45f5dc72b240b344435076c120e394accfc79c 100644
(file)
--- 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;
{
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");
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;
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;
if (!refspec->dst)
continue;