]> git.ipfire.org Git - thirdparty/git.git/blobdiff - unpack-trees.c
Merge branch 'jt/t5500-unflake'
[thirdparty/git.git] / unpack-trees.c
index 1fe3764f2b217263d00332bcca203f0c9ef6ee5f..02048dfdac8ab721b432f24a3dbcefc67f564e37 100644 (file)
@@ -562,11 +562,11 @@ static int warn_conflicted_path(struct index_state *istate,
 
        add_rejected_path(o, WARNING_SPARSE_UNMERGED_FILE, conflicting_path);
 
-       /* Find out how many higher stage entries at same path */
-       while (++count < istate->cache_nr &&
-              !strcmp(conflicting_path,
-                      istate->cache[i+count]->name))
-               /* do nothing */;
+       /* Find out how many higher stage entries are at same path */
+       while ((++count) + i < istate->cache_nr &&
+              !strcmp(conflicting_path, istate->cache[count + i]->name))
+               ; /* do nothing */
+
        return count;
 }