summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2014-04-02 07:45:16 -0700
committerRussell Belfer <rb@github.com>2014-04-02 07:45:16 -0700
commitada157b2375bea8ed0c7a71320a3325a9903ebd7 (patch)
tree5803bc586546e047abba8818d23180dd8fd25ff9
parentd1a0900442a235d8389d968a70b196a1b0f1ab7b (diff)
downloadlibgit2-ada157b2375bea8ed0c7a71320a3325a9903ebd7.tar.gz
Add warning when skipping blame test
-rw-r--r--tests/blame/simple.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/tests/blame/simple.c b/tests/blame/simple.c
index c0d91058a..86e8fe264 100644
--- a/tests/blame/simple.c
+++ b/tests/blame/simple.c
@@ -135,18 +135,13 @@ void test_blame_simple__trivial_libgit2(void)
git_blame_options opts = GIT_BLAME_OPTIONS_INIT;
git_object *obj;
- /* If we can't open the libgit2 repo, just skip this test */
- if (git_repository_open(&g_repo, cl_fixture("../..")) < 0) {
- giterr_clear();
- return;
- }
-
- /* This test can't work on a shallow clone */
- if (git_repository_is_shallow(g_repo))
- return;
-
- /* If somehow it is not a valid libgit2 repo, just move along */
- if (git_revparse_single(&obj, g_repo, "359fc2d") < 0) {
+ /* If we can't open the libgit2 repo or if it isn't a full repo
+ * with proper history, just skip this test */
+ if (git_repository_open(&g_repo, cl_fixture("../..")) < 0 ||
+ git_repository_is_shallow(g_repo) ||
+ git_revparse_single(&obj, g_repo, "359fc2d") < 0)
+ {
+ printf("NOT INSIDE VALID LIBGIT2 REPO; skipping blame test\n");
giterr_clear();
return;
}