diff options
author | Carlos Martín Nieto <cmn@elego.de> | 2013-03-07 19:38:44 +0400 |
---|---|---|
committer | Carlos Martín Nieto <cmn@elego.de> | 2013-03-07 19:38:44 +0400 |
commit | bb45c57f94d3c7c96e78234e2a81393c0ced45a0 (patch) | |
tree | e501f5be5296ce8d894e69867eb511a6be81fa27 /tests-clar/refs | |
parent | 9952f24e6cc71ef5ecd13831f783e308aae97c36 (diff) |
refs: explicitly catch leading slashes
It's somewhat common to try to write "/refs/tags/something". There is
no easy way to catch it during the main body of the function, as there
is no way to distinguish whether it's a leading slash or a double
slash somewhere in the middle.
Catch this at the beginning so we don't trigger the assert in
is_all_caps_and_underscore().
Diffstat (limited to 'tests-clar/refs')
-rw-r--r-- | tests-clar/refs/lookup.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests-clar/refs/lookup.c b/tests-clar/refs/lookup.c index 11fd68f90..0dbebc5c2 100644 --- a/tests-clar/refs/lookup.c +++ b/tests-clar/refs/lookup.c @@ -32,6 +32,12 @@ void test_refs_lookup__with_resolve(void) git_reference_free(a); } +void test_refs_lookup__invalid_name(void) +{ + git_oid oid; + cl_git_fail(git_reference_name_to_id(&oid, g_repo, "/refs/tags/point_to_blob")); +} + void test_refs_lookup__oid(void) { git_oid tag, expected; |