add -use_find_cache
for $(shell if [ -d $1 ] ; then cd $1 ; find ./ -not -name '.*' -and -type f -and -not -type l ; fi),
it will look up find cache instead of invoking shell command.
% time ./repo/android.sh kati -c >/dev/null
find: `dummy': No such file or directory
find: `dummy': No such file or directory
fatal: Not a git repository: 'packages/apps/Camera2/.git'
./repo/android.sh kati -c > /dev/null 34.08s user 41.16s system 131% cpu 57.423 total
% time ./repo/android.sh kati -c -use_find_cache >/dev/null
find: `dummy': No such file or directory
find: `dummy': No such file or directory
fatal: Not a git repository: 'packages/apps/Camera2/.git'
./repo/android.sh kati -c -use_find_cache > /dev/null 35.82s user 33.25s system 142% cpu 48.495 total
3 files changed