Commit 69a3c766 by Carlos Martín Nieto

refdb_fs: don't crash when the repo doesn't have a path

parent 4def7035
...@@ -181,6 +181,9 @@ static int packed_load(refdb_fs_backend *backend) ...@@ -181,6 +181,9 @@ static int packed_load(refdb_fs_backend *backend)
GITERR_CHECK_ALLOC(ref_cache->packfile); GITERR_CHECK_ALLOC(ref_cache->packfile);
} }
if (backend->path == NULL)
return 0;
result = reference_read(&packfile, &ref_cache->packfile_time, result = reference_read(&packfile, &ref_cache->packfile_time,
backend->path, GIT_PACKEDREFS_FILE, &updated); backend->path, GIT_PACKEDREFS_FILE, &updated);
...@@ -1150,6 +1153,10 @@ static int setup_namespace(git_buf *path, git_repository *repo) ...@@ -1150,6 +1153,10 @@ static int setup_namespace(git_buf *path, git_repository *repo)
{ {
char *parts, *start, *end; char *parts, *start, *end;
/* Not all repositories have a path */
if (repo->path_repository == NULL)
return 0;
/* Load the path to the repo first */ /* Load the path to the repo first */
git_buf_puts(path, repo->path_repository); git_buf_puts(path, repo->path_repository);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment