mirror of
https://github.com/git-for-windows/git.git
synced 2026-05-05 05:58:01 -05:00
built-in add -i: refresh the index before running status
This is what the Perl version does, and therefore it is what the built-in version should do, too. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
@@ -258,7 +258,9 @@ int run_add_i(struct repository *r, const struct pathspec *ps)
|
||||
_("staged"), _("unstaged"), _("path"));
|
||||
opts.header = header.buf;
|
||||
|
||||
res = run_status(r, ps, &files, &opts);
|
||||
repo_refresh_and_write_index(r, REFRESH_QUIET, 1);
|
||||
if (run_status(r, ps, &files, &opts) < 0)
|
||||
res = -1;
|
||||
|
||||
release_file_list(&files);
|
||||
strbuf_release(&print_file_item_data.buf);
|
||||
|
||||
Reference in New Issue
Block a user