aboutsummaryrefslogtreecommitdiff
path: root/refs.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-06-11 13:31:23 -0700
committerJunio C Hamano <gitster@pobox.com>2013-06-11 13:31:23 -0700
commitbb1c8fbcc86b31a1e86a1f6cadcb82d67fab1dc0 (patch)
tree6f68b3eab895b3b5af84a47925f910d0c8b26a99 /refs.c
parent96d339f1e345e4457c4409f29a84d13254489621 (diff)
parent1f27e7d56b65fdc232a5a2a4de2ee97ff5eb176b (diff)
downloadgit-bb1c8fbcc86b31a1e86a1f6cadcb82d67fab1dc0.tar.gz
git-bb1c8fbcc86b31a1e86a1f6cadcb82d67fab1dc0.tar.xz
Merge branch 'fc/at-head'
Instead of typing four capital letters "HEAD", you can say "@" instead. * fc/at-head: sha1_name: compare variable with constant, not constant with variable Add new @ shortcut for HEAD sha1_name: refactor reinterpret() sha1_name: check @{-N} errors sooner sha1_name: reorganize get_sha1_basic() sha1_name: don't waste cycles in the @-parsing loop sha1_name: remove unnecessary braces sha1_name: remove no-op tests: at-combinations: @{N} versus HEAD@{N} tests: at-combinations: increase coverage tests: at-combinations: improve nonsense() tests: at-combinations: check ref names directly tests: at-combinations: simplify setup
Diffstat (limited to 'refs.c')
-rw-r--r--refs.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/refs.c b/refs.c
index d17931a8b..42a7e17f6 100644
--- a/refs.c
+++ b/refs.c
@@ -72,6 +72,10 @@ int check_refname_format(const char *refname, int flags)
{
int component_len, component_count = 0;
+ if (!strcmp(refname, "@"))
+ /* Refname is a single character '@'. */
+ return -1;
+
while (1) {
/* We are at the start of a path component. */
component_len = check_refname_component(refname, flags);