From: Nika Layzell <nika@xxxxxxxxxxxxxxx> Uses the FILTER flag on patch flavours in git-add--interactive to determine if the initial index refresh call is required. It is not required for the reset patch modes, which use the 'index-only' filter, as they do not interact with the worktree, so do not need up-to-date stat information. The refresh call can be quite expensive, especially on larger checkouts or with a freshly created index file. Signed-off-by: Nika Layzell <nika@xxxxxxxxxxxxxxx> --- git-add--interactive.perl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/git-add--interactive.perl b/git-add--interactive.perl index c20ae9e210..cd435b197f 100755 --- a/git-add--interactive.perl +++ b/git-add--interactive.perl @@ -1861,7 +1861,9 @@ sub main_loop { } process_args(); -refresh(); +if ($patch_mode_flavour{FILTER} ne 'index-only') { + refresh(); +} if ($patch_mode_only) { patch_update_cmd(); } -- gitgitgadget