Commit d6ccedddd2f76d69b05ecfa45a93cde8682776e6

Russell Belfer 2011-12-14T10:52:28

Check error on path manipulations. This commit fixes #511.

1
2
3
4
5
6
7
8
9
10
11
12
diff --git a/src/status.c b/src/status.c
index 05e07be..64be6ce 100644
--- a/src/status.c
+++ b/src/status.c
@@ -370,6 +370,7 @@ static int dirent_cb(void *state, git_buf *a)
 			if (git_tree_entry_type(m) == GIT_OBJ_TREE)
 				git_path_to_dir(&st->head_tree_relative_path);
 
+			error = git_buf_lasterror(&st->head_tree_relative_path);
 			if (error < GIT_SUCCESS)
 				return git__rethrow(error, "An error occured while determining the status of '%s'", a->ptr);