summaryrefslogtreecommitdiff
path: root/src/repository.c
diff options
context:
space:
mode:
authorVicent Marti <vicent@github.com>2014-02-19 00:21:38 +0100
committerVicent Marti <vicent@github.com>2014-02-19 00:21:38 +0100
commit2dc49ea93c5c320216806089fee579021f3ce9cf (patch)
tree84f1fdd97a538cc0a78882150de786d049dd2953 /src/repository.c
parente0ebaaa53ea1154a1f392dae463453ac6c428d78 (diff)
parent864535cf850973378c8283f62347055d2593c685 (diff)
downloadlibgit2-2dc49ea93c5c320216806089fee579021f3ce9cf.tar.gz
Merge pull request #2124 from libgit2/better-shallow-errors
Improve error propagation in shallow call
Diffstat (limited to 'src/repository.c')
-rw-r--r--src/repository.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/repository.c b/src/repository.c
index 9f0c2f68f..96ed30666 100644
--- a/src/repository.c
+++ b/src/repository.c
@@ -2001,9 +2001,12 @@ 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 error;
return st.st_size == 0 ? 0 : 1;
}