Commit 16604d74697cff526b0fc1cd2b03bedd56641059

Carlos Martín Nieto 2015-11-11T00:36:15

index: correctly report which conflict stage has a wrong filemode When we're at offset 'i', we're dealing with the 'i+1' stage, since conflicts start at 1.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/index.c b/src/index.c
index dcf46fe..f9fff27 100644
--- a/src/index.c
+++ b/src/index.c
@@ -1691,7 +1691,7 @@ int git_index_conflict_add(git_index *index,
 	for (i = 0; i < 3; i++) {
 		if (entries[i] && !valid_filemode(entries[i]->mode)) {
 			giterr_set(GITERR_INDEX, "invalid filemode for stage %d entry",
-				i);
+				i + 1);
 			return -1;
 		}
 	}