revert c191ed664f6c437ebc3e0c859c53e48b445401f1 'got ref' should only work with naked ref names; implicitly putting things into 'refs/heads' is a job for something like a 'got branch' command.
diff --git a/lib/reference.c b/lib/reference.c
index 1ddd447..e572d68 100644
--- a/lib/reference.c
+++ b/lib/reference.c
@@ -290,19 +290,10 @@ const struct got_error *
got_ref_alloc(struct got_reference **ref, const char *name,
struct got_object_id *id)
{
- const struct got_error *err;
- char *absname = NULL;
-
- if (!is_valid_ref_name(name)) {
- if (strchr(name, '/') != NULL)
- return got_error(GOT_ERR_BAD_REF_NAME);
- if (asprintf(&absname, "refs/heads/%s", name) == -1)
- return got_error_from_errno("asprintf");
- }
+ if (!is_valid_ref_name(name))
+ return got_error(GOT_ERR_BAD_REF_NAME);
- err = alloc_ref(ref, absname ? absname : name, id, 0);
- free(absname);
- return err;
+ return alloc_ref(ref, name, id, 0);
}
static const struct got_error *