From d32ae99de9337af5e957805f0677835a6a019966 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Mon, 8 May 2023 21:21:18 -0700 Subject: [PATCH] Update set_repo function to check if file is tracked using git ls-files command. --- coder.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/coder.py b/coder.py index bbdf31562..b563c55b2 100755 --- a/coder.py +++ b/coder.py @@ -95,7 +95,8 @@ class Coder: new_files = [] for fname in self.fnames: relative_fname = os.path.relpath(fname, repo.working_tree_dir) - if relative_fname not in repo.untracked_files: + tracked_files = set(repo.git.ls_files().splitlines()) + if relative_fname not in tracked_files and relative_fname not in repo.untracked_files: continue new_files.append(relative_fname)