summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-08-05 08:41:33 -0300
committerWerner Almesberger <werner@almesberger.net>2016-08-05 08:41:33 -0300
commit3b707117c9836c88df9d0d049f1113b4bdbc2600 (patch)
tree917bdc4f1d9af46f703c9ae04c0ab44f3d4df6d2
parent077dad21638b67dd5f76981ee3837443a89df207 (diff)
downloadeeshow-3b707117c9836c88df9d0d049f1113b4bdbc2600.tar.gz
eeshow-3b707117c9836c88df9d0d049f1113b4bdbc2600.tar.bz2
eeshow-3b707117c9836c88df9d0d049f1113b4bdbc2600.zip
eeshow/git-hist.c (vcs_git_try): ignore repo if empty or corrupted
-rw-r--r--git-hist.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/git-hist.c b/git-hist.c
index 21681a0..53e66c5 100644
--- a/git-hist.c
+++ b/git-hist.c
@@ -132,8 +132,10 @@ bool vcs_git_try(const char *path)
vcs_git_init();
- return !git_repository_open_ext(&repo, path,
- GIT_REPOSITORY_OPEN_CROSS_FS, NULL);
+ if (git_repository_open_ext(&repo, path,
+ GIT_REPOSITORY_OPEN_CROSS_FS, NULL))
+ return 0;
+ return !git_repository_is_empty(repo);
}