{
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);
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;
int flags, enum action_on_err onerr)
{
struct ref_lock *lock;
- lock = update_ref_lock(refname, oldval, flags, 0, onerr);
+ lock = update_ref_lock(refname, oldval, flags, NULL, onerr);
if (!lock)
return 1;
return update_ref_write(action, refname, sha1, lock, onerr);