aboutsummaryrefslogtreecommitdiff
path: root/remote.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-02-27 11:54:28 -0800
committerJunio C Hamano <gitster@pobox.com>2008-02-27 11:54:28 -0800
commit2f8e2e3eeffd427a82467556941c31dc246a69c5 (patch)
tree27c751ef65f0c0baf38c52264038f774d38df56c /remote.c
parent5372715ed268b190b022a12579767816ea6738ae (diff)
parent9f0ea7e8283da126c8e1d5e0c3b39c39200258ad (diff)
downloadgit-2f8e2e3eeffd427a82467556941c31dc246a69c5.tar.gz
git-2f8e2e3eeffd427a82467556941c31dc246a69c5.tar.xz
Merge branch 'db/push-single-with-HEAD'
* db/push-single-with-HEAD: Resolve value supplied for no-colon push refspecs
Diffstat (limited to 'remote.c')
-rw-r--r--remote.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/remote.c b/remote.c
index 1f8369675..45560d900 100644
--- a/remote.c
+++ b/remote.c
@@ -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)) {