Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/repository.c')
-rw-r--r--src/repository.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/repository.c b/src/repository.c
index 9f0c2f68f..89ae32473 100644
--- a/src/repository.c
+++ b/src/repository.c
@@ -2001,9 +2001,10 @@ int git_repository_is_shallow(git_repository *repo)
error = git_path_lstat(path.ptr, &st);
git_buf_free(&path);
- if (error == GIT_ENOTFOUND)
+ if (error == GIT_ENOTFOUND) {
+ giterr_clear();
return 0;
- if (error < 0)
- return -1;
- return st.st_size == 0 ? 0 : 1;
+ }
+
+ return error < 0 ? error : st.st_size == 0 ? 0 : 1;
}