From 59e9149f753eb195ecc71d97e45104b702ffd65a Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C4=81nis=20R=C5=ABcis?= Date: Mon, 16 Aug 2010 17:33:53 +0300 Subject: [PATCH] import-pk3: force reading of .gitignore from index --- misc/tools/git-import-pk3 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/misc/tools/git-import-pk3 b/misc/tools/git-import-pk3 index f9680ac7..b6d04826 100755 --- a/misc/tools/git-import-pk3 +++ b/misc/tools/git-import-pk3 @@ -109,9 +109,15 @@ die "couldn't initialize index" [ -z "$(git diff-files --diff-filter=M)" ] || die "found changes to files in master" +# Force reading of .gitignore files from cache, not the work tree +git ls-files --cached -z | +grep -z '\.gitignore$' | +git update-index --skip-worktree -z --stdin || +die "couldn't set up exclude patterns from index" + # Add untracked files; to filter out generated files such as BSP, add -# them to .gitignore and push, --exclude-standard should take care of -# the rest +# them to .gitignore and push, --exclude-standard (and the above hack) +# takes care of the rest git ls-files --exclude-standard -o -z | git update-index --add -z --stdin || die "couldn't add files to index" -- 2.39.2