builtin_diff(): read $GIT_DIFF_OPTS closer to use
[gitweb.git] / rerere.c
index 16c8aac6211ac74de77b1f2cad5eddb4d1abcc95..783d4dae2aa2d7a17c37dfac892e1acdeb4b1db8 100644 (file)
--- a/rerere.c
+++ b/rerere.c
@@ -533,7 +533,7 @@ static int check_one_conflict(int i, int *type)
        }
 
        *type = PUNTED;
-       while (ce_stage(active_cache[i]) == 1)
+       while (i < active_nr && ce_stage(active_cache[i]) == 1)
                i++;
 
        /* Only handle regular files with both stages #2 and #3 */
@@ -1120,7 +1120,7 @@ int rerere_forget(struct pathspec *pathspec)
        find_conflict(&conflict);
        for (i = 0; i < conflict.nr; i++) {
                struct string_list_item *it = &conflict.items[i];
-               if (!match_pathspec(pathspec, it->string,
+               if (!match_pathspec(&the_index, pathspec, it->string,
                                    strlen(it->string), 0, NULL, 0))
                        continue;
                rerere_forget_one_path(it->string, &merge_rr);