Commit 4497287321d2d2624316b38c00a032a5e890e88f

Edward Thomson 2015-05-11T14:02:53

stash: propagate the error when writing a tree

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/stash.c b/src/stash.c
index 71ab7b9..c79068e 100644
--- a/src/stash.c
+++ b/src/stash.c
@@ -106,7 +106,7 @@ static int build_tree_from_index(git_tree **out, git_index *index)
 	git_oid i_tree_oid;
 
 	if ((error = git_index_write_tree(&i_tree_oid, index)) < 0)
-		return -1;
+		return error;
 
 	return git_tree_lookup(out, git_index_owner(index), &i_tree_oid);
 }