@@ -297,21 +297,21 @@ cmd_decrypt () {
297
297
trap " rm -rf \" $temp_dir \" " INT HUP TERM EXIT
298
298
299
299
have_commitable_changes () { WORK_TREE=" $temp_dir " git_plain diff --staged --quiet; }
300
- read_decrypt_and_git_add_files () {
301
- while IFS=" $_tab " _read_vars _enc_path _plain_path; do
302
- WORK_TREE=" $temp_dir " YES_OVERWRITE=1 _decrypt_file " $_enc_path " " $_plain_path "
303
- WORK_TREE=" $temp_dir " git_plain add -vf " $_plain_path " # -f to ignore .gitignore
304
- done
305
- }
300
+ decrypt_one () { WORK_TREE=" $temp_dir " YES_OVERWRITE=1 _decrypt_file " $1 " " $2 " ; }
301
+ git_add_files () { WORK_TREE=" $temp_dir " git_plain add -vf " $@ " ; } # -f to ignore .gitignore
306
302
307
303
_ask_pw
308
304
_bind_tty_fd7
309
305
if [ " ${1:- } " = " --squash" ]; then
310
306
git_enc sparse-checkout disable
311
- git_enc ls-files " manifest/" |
312
- grep -RFhf- " $PLAIN_REPO /manifest" |
313
- sort -u |
314
- read_decrypt_and_git_add_files
307
+ # Files available as of the current ref and for which password exists
308
+ available_files=" $( git_enc ls-files |
309
+ grep -RFhf- " $PLAIN_REPO /manifest" |
310
+ sort -u -k2) "
311
+ echo " $available_files " |
312
+ _parallelize 0 2 decrypt_one
313
+ # shellcheck disable=SC2046
314
+ git_add_files $( echo " $available_files " | cut -f2)
315
315
if ! have_commitable_changes; then
316
316
WORK_TREE=" $temp_dir " git_plain commit -m " Restore '$1 ' at $( date ' +%Y-%m-%d %H:%M:%S%z' ) "
317
317
fi
@@ -328,7 +328,9 @@ cmd_decrypt () {
328
328
# Decrypt and stage files from this commit into temp_dir
329
329
plain_commit=" $( git_enc show --name-only --pretty=format: " $_enc_commit " -- " manifest/" |
330
330
cut -d/ -f2) "
331
- read_decrypt_and_git_add_files < " $PLAIN_REPO /manifest/$plain_commit "
331
+ _parallelize 0 2 decrypt_one < " $PLAIN_REPO /manifest/$plain_commit "
332
+ # shellcheck disable=SC2046
333
+ git_add_files $( cut -f2 " $PLAIN_REPO /manifest/$plain_commit " )
332
334
333
335
# Commit the changes to the plain repo
334
336
_msg=" $( git_enc show -s --format=' %B' " $_enc_commit " |
0 commit comments