mirror of
https://git.proxmox.com/git/libgit2
synced 2025-11-02 03:01:53 +00:00
refdb_fs: don't crash when the repo doesn't have a path
This commit is contained in:
parent
4def7035ca
commit
69a3c766b6
@ -181,6 +181,9 @@ static int packed_load(refdb_fs_backend *backend)
|
||||
GITERR_CHECK_ALLOC(ref_cache->packfile);
|
||||
}
|
||||
|
||||
if (backend->path == NULL)
|
||||
return 0;
|
||||
|
||||
result = reference_read(&packfile, &ref_cache->packfile_time,
|
||||
backend->path, GIT_PACKEDREFS_FILE, &updated);
|
||||
|
||||
@ -1150,6 +1153,10 @@ static int setup_namespace(git_buf *path, git_repository *repo)
|
||||
{
|
||||
char *parts, *start, *end;
|
||||
|
||||
/* Not all repositories have a path */
|
||||
if (repo->path_repository == NULL)
|
||||
return 0;
|
||||
|
||||
/* Load the path to the repo first */
|
||||
git_buf_puts(path, repo->path_repository);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user