Merge branch 'fc/at-head'

Instead of typing four capital letters "HEAD", you can say "@" now,
e.g. "git log @".

* fc/at-head:
  Add new @ shortcut for HEAD
  sha1-name: pass len argument to interpret_branch_name()
This commit is contained in:
Junio C Hamano
2013-09-20 12:38:10 -07:00
7 changed files with 54 additions and 7 deletions

6
refs.c
View File

@ -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);
@ -1951,7 +1955,7 @@ static int remove_empty_directories(const char *file)
static char *substitute_branch_name(const char **string, int *len)
{
struct strbuf buf = STRBUF_INIT;
int ret = interpret_branch_name(*string, &buf);
int ret = interpret_branch_name(*string, *len, &buf);
if (ret == *len) {
size_t size;