Commit 4de89ce7 by nulltoken

revparse: unfound partially-named ref returns ENOTFOUND

parent cbc02c10
...@@ -107,7 +107,7 @@ static int revparse_lookup_object(git_object **out, git_repository *repo, const ...@@ -107,7 +107,7 @@ static int revparse_lookup_object(git_object **out, git_repository *repo, const
git_buf_free(&refnamebuf); git_buf_free(&refnamebuf);
giterr_set(GITERR_REFERENCE, "Refspec '%s' not found.", spec); giterr_set(GITERR_REFERENCE, "Refspec '%s' not found.", spec);
return GIT_ERROR; return GIT_ENOTFOUND;
} }
......
...@@ -38,10 +38,9 @@ void test_refs_revparse__cleanup(void) ...@@ -38,10 +38,9 @@ void test_refs_revparse__cleanup(void)
cl_setenv("TZ", g_orig_tz); cl_setenv("TZ", g_orig_tz);
} }
void test_refs_revparse__nonexistant_object(void) void test_refs_revparse__nonexistant_object(void)
{ {
cl_git_fail(git_revparse_single(&g_obj, g_repo, "this doesn't exist")); cl_assert_equal_i(GIT_ENOTFOUND, git_revparse_single(&g_obj, g_repo, "this doesn't exist"));
cl_git_fail(git_revparse_single(&g_obj, g_repo, "this doesn't exist^1")); cl_git_fail(git_revparse_single(&g_obj, g_repo, "this doesn't exist^1"));
cl_git_fail(git_revparse_single(&g_obj, g_repo, "this doesn't exist~2")); cl_git_fail(git_revparse_single(&g_obj, g_repo, "this doesn't exist~2"));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment