Commit 4de89ce72aa66fe2141f973960c3baf1e373a827

nulltoken 2012-06-29T16:51:46

revparse: unfound partially-named ref returns ENOTFOUND

diff --git a/src/revparse.c b/src/revparse.c
index 5050bdf..b895b90 100644
--- a/src/revparse.c
+++ b/src/revparse.c
@@ -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;
 }
 
 
diff --git a/tests-clar/refs/revparse.c b/tests-clar/refs/revparse.c
index c71e6d8..7c5c917 100644
--- a/tests-clar/refs/revparse.c
+++ b/tests-clar/refs/revparse.c
@@ -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"));
 }