revparse: unfound partially-named ref returns ENOTFOUND

This commit is contained in:
nulltoken 2012-06-29 16:51:46 +02:00
parent cbc02c1021
commit 4de89ce72a
2 changed files with 2 additions and 3 deletions

View File

@ -107,7 +107,7 @@ static int revparse_lookup_object(git_object **out, git_repository *repo, const
git_buf_free(&refnamebuf);
giterr_set(GITERR_REFERENCE, "Refspec '%s' not found.", spec);
return GIT_ERROR;
return GIT_ENOTFOUND;
}

View File

@ -38,10 +38,9 @@ void test_refs_revparse__cleanup(void)
cl_setenv("TZ", g_orig_tz);
}
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~2"));
}