From d5abcefc98ed12b1f403329c02abc67b8ea8e0a7 Mon Sep 17 00:00:00 2001 From: Rajesh Kumar Thandapani Date: Thu, 10 Nov 2022 15:28:21 +0530 Subject: [PATCH] Added a workaround for a bug in git ls-files command. --- ci/fix_gitignore.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ci/fix_gitignore.sh b/ci/fix_gitignore.sh index 50f0a43bb..1665a8db2 100755 --- a/ci/fix_gitignore.sh +++ b/ci/fix_gitignore.sh @@ -5,7 +5,8 @@ source ci/ci_helpers.sh # Remove all the ignored files from git tree, and error out # find all ignored files in git tree, and use quotation marks to prevent word splitting on filenames with spaces in them -ignored_lines_in_git_tree=$(git ls-files --ignored --exclude-standard | sed 's/.*/"&"/') +# NOTE: Option --cached is neeed to avoid a bug in git ls-files command. +ignored_lines_in_git_tree=$(git ls-files --ignored --cached --exclude-standard | sed 's/.*/"&"/') if [[ -n $ignored_lines_in_git_tree ]] then