summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/object.c2
-rw-r--r--src/odb_loose.c4
2 files changed, 5 insertions, 1 deletions
diff --git a/src/object.c b/src/object.c
index 3847a0739..93068b85f 100644
--- a/src/object.c
+++ b/src/object.c
@@ -375,7 +375,7 @@ int git_object_lookup_bypath(
assert(out && treeish && path);
- if ((error = git_object_peel((git_object**)&tree, treeish, GIT_OBJ_TREE) < 0) ||
+ if ((error = git_object_peel((git_object**)&tree, treeish, GIT_OBJ_TREE)) < 0 ||
(error = git_tree_entry_bypath(&entry, tree, path)) < 0)
{
goto cleanup;
diff --git a/src/odb_loose.c b/src/odb_loose.c
index 7b46a6652..b2e8bed4d 100644
--- a/src/odb_loose.c
+++ b/src/odb_loose.c
@@ -755,6 +755,10 @@ static int foreach_cb(void *_state, git_buf *path)
{
struct foreach_state *state = (struct foreach_state *) _state;
+ /* non-dir is some stray file, ignore it */
+ if (!git_path_isdir(git_buf_cstr(path)))
+ return 0;
+
return git_path_direach(path, 0, foreach_object_dir_cb, state);
}