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
This commit is contained in:
4
refs.c
4
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);
|
||||
|
||||
Reference in New Issue
Block a user