Commit 6e9afb97d14545f9cea292f581de89d610ae8c07

Carlos Martín Nieto 2014-05-06T21:14:58

object: fix a brace The brace in the check for peel's return was surrounding the wrong thing, which made 'error' be set to 1 when there was an error instead of the error code.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/object.c b/src/object.c
index 3847a07..93068b8 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;