Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Prevent send-pack from segfaulting (backport from 'master')
author
Junio C Hamano
<gitster@pobox.com>
Tue, 30 Oct 2007 18:30:43 +0000
(11:30 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Tue, 30 Oct 2007 23:21:56 +0000
(16:21 -0700)
4491e62ae932d5774f628d1bd3be663c11058a73
(Prevent send-pack from
segfaulting when a branch doesn't match) is hereby cherry-picked
back to 'maint'.
If we can't find a source match, and we have no destination, we
need to abort the match function early before we try to match
the destination against the remote.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
remote.c
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
562e35c
)
diff --git
a/remote.c
b/remote.c
index cdbbdcb00dee400f4fe654a86c1dd0060a613904..9a88917aab32f32235d0ebaa1ffd0e2f2773a927 100644
(file)
--- a/
remote.c
+++ b/
remote.c
@@
-504,8
+504,11
@@
static int match_explicit(struct ref *src, struct ref *dst,
if (!matched_src)
errs = 1;
- if (dst_value == NULL)
+ if (!dst_value) {
+ if (!matched_src)
+ return errs;
dst_value = matched_src->name;
+ }
switch (count_refspec_match(dst_value, dst, &matched_dst)) {
case 1: