From: Nika Layzell via GitGitGadget Date: Sat, 23 Nov 2019 19:56:40 GMT Subject: [PATCH 1/1] add--interactive: skip index refresh in reset patch mode Message-ID: <68f3be6ca65b3904bd4664b743fccbe1ac4e7d22.1574539001.git.gitgitgadget@gmail.com> In-Reply-To: From: Nika Layzell 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 --- 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