summaryrefslogtreecommitdiff
path: root/refs.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-12-13 18:30:11 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-12-13 18:30:11 (GMT)
commit37adac765a469f8f8495e2befe7afeda65a2b272 (patch)
tree2a9b96df44e37a717ee01a782c120d3ef089417a /refs.c
parent411fb8baa6862b76f7bdd9fc0d5844855a4db589 (diff)
downloadgit-37adac765a469f8f8495e2befe7afeda65a2b272.zip
git-37adac765a469f8f8495e2befe7afeda65a2b272.tar.gz
git-37adac765a469f8f8495e2befe7afeda65a2b272.tar.bz2
send-pack: tighten checks for remote names
"git push $URL HEAD~6" created a bogus ref HEAD~6 immediately under $GIT_DIR of the remote repository. While we should keep refspecs that have arbitrary extended SHA-1 expression on the source side working (e.g. "HEAD~6:refs/tags/yesterday"), we should not create bogus ref on the other end. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'refs.c')
-rw-r--r--refs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/refs.c b/refs.c
index 96ea8b6..e56abb8 100644
--- a/refs.c
+++ b/refs.c
@@ -534,7 +534,7 @@ int check_ref_format(const char *ref)
level++;
if (!ch) {
if (level < 2)
- return -1; /* at least of form "heads/blah" */
+ return -2; /* at least of form "heads/blah" */
return 0;
}
}