diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-09-20 12:38:10 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-09-20 12:38:10 -0700 |
commit | f406140baa5128bfa537c271c7292a866c08b7d4 (patch) | |
tree | c52ee64bfc197e86ee928f8e40056f46ab0f7be9 /refs.c | |
parent | 005a1de380733477382c50e2e44ed8042c401fed (diff) | |
parent | 9ba89f484e023827eca6ad44baf69af37dac4db3 (diff) | |
download | git-f406140baa5128bfa537c271c7292a866c08b7d4.tar.gz |
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()
Diffstat (limited to 'refs.c')
-rw-r--r-- | refs.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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; |