Merge branch 'db/push-single-with-HEAD'

* db/push-single-with-HEAD:
  Resolve value supplied for no-colon push refspecs
This commit is contained in:
Junio C Hamano
2008-02-27 11:54:28 -08:00
3 changed files with 52 additions and 10 deletions

View File

@ -730,9 +730,17 @@ static int match_explicit(struct ref *src, struct ref *dst,
errs = 1;
if (!dst_value) {
unsigned char sha1[20];
int flag;
if (!matched_src)
return errs;
dst_value = matched_src->name;
dst_value = resolve_ref(matched_src->name, sha1, 1, &flag);
if (!dst_value ||
((flag & REF_ISSYMREF) &&
prefixcmp(dst_value, "refs/heads/")))
die("%s cannot be resolved to branch.",
matched_src->name);
}
switch (count_refspec_match(dst_value, dst, &matched_dst)) {