summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2011-03-15 19:55:01 +0200
committerVicent Marti <tanoku@gmail.com>2011-03-15 19:55:01 +0200
commitb5abb881a623b8b492e0375b8e9c8936079c39bb (patch)
treec24dfb2c039739cb25e6a6656f8ae4e65ae45f5d /src
parentd40d30cb76ddcc9935471af0fb6fa6b2a66efc4c (diff)
downloadlibgit2-b5abb881a623b8b492e0375b8e9c8936079c39bb.tar.gz
Do not segfault when listing unpacked references
Diffstat (limited to 'src')
-rw-r--r--src/refs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/refs.c b/src/refs.c
index cb11159fb..ea39608df 100644
--- a/src/refs.c
+++ b/src/refs.c
@@ -560,7 +560,8 @@ static int _dirent_loose_listall(void *_data, char *full_path)
return gitfo_dirent(full_path, GIT_PATH_MAX, _dirent_loose_listall, _data);
/* do not add twice a reference that exists already in the packfile */
- if (git_hashtable_lookup(data->repo->references.packfile, file_path) != NULL)
+ if ((data->list_flags & GIT_REF_PACKED) != 0 &&
+ git_hashtable_lookup(data->repo->references.packfile, file_path) != NULL)
return GIT_SUCCESS;
if ((data->list_flags & loose_guess_rtype(full_path)) == 0)