summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-12-08 01:48:38 (GMT)
committerWerner Almesberger <werner@almesberger.net>2016-12-08 01:48:38 (GMT)
commitccb56f7230a83083d3e4f1703e5530dcd7c6e64a (patch)
treebd429d67bb226d947724647bd47802b1d580f1f7
parentc31b787125d1d103b9e0da15d7d4359802e8b5f6 (diff)
downloadeeshow-ccb56f7230a83083d3e4f1703e5530dcd7c6e64a.zip
eeshow-ccb56f7230a83083d3e4f1703e5530dcd7c6e64a.tar.gz
eeshow-ccb56f7230a83083d3e4f1703e5530dcd7c6e64a.tar.bz2
file/git-util.c: handling of realpath errors broke eeshow rev:file
-rw-r--r--file/git-util.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/file/git-util.c b/file/git-util.c
index a1e4dbf..b6de598 100644
--- a/file/git-util.c
+++ b/file/git-util.c
@@ -132,8 +132,16 @@ int git_repository_open_ext_caching(git_repository **out, const char *path,
ceiling_dirs);
tmp = realpath(path, NULL);
+ /*
+ * If realpath failed, libgit2 will fail to open "path", too.
+ * Since git_repository_open_ext_caching is supposed to be just like
+ * git_repository_open_ext, including the handling of diagnostics, we
+ * let do_git_repository_open_ext_caching generate the error, instead
+ * of trying to return immediately.
+ */
if (!tmp)
- diag_pfatal(path);
+ tmp = stralloc(path);
+
slash = strrchr(tmp, '/');
if (slash)
slash = 0;