Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions builtin/add.c
Original file line number Diff line number Diff line change
Expand Up @@ -487,13 +487,13 @@ int cmd_add(int argc,
(!(addremove || take_worktree_changes)
? ADD_CACHE_IGNORE_REMOVAL : 0));

enable_fscache(0);
if (repo_read_index_preload(repo, &pathspec, 0) < 0)
die(_("index file corrupt"));

die_in_unpopulated_submodule(repo->index, prefix);
die_path_inside_submodule(repo->index, &pathspec);

enable_fscache(0);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This basically moves enable_fscache(0); around, so that the repo_read_index_preload() call benefits from FSCache. This should be a fixup for 6d30b7e.

That commit is a heavily adapted version of 38df35b. It was I who introduced this bug, in 19b6958.

/* We do not really re-read the index but update the up-to-date flags */
preload_index(repo->index, &pathspec, 0);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep this empty line.

Expand Down Expand Up @@ -609,6 +609,6 @@ int cmd_add(int argc,
free(ps_matched);
dir_clear(&dir);
clear_pathspec(&pathspec);
enable_fscache(0);
disable_fscache();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call. This was missed in 6378e39.

return exit_status;
}
Loading