diff --git a/bin/blackbox_register_new_file b/bin/blackbox_register_new_file index f855ad8..4a76e7a 100755 --- a/bin/blackbox_register_new_file +++ b/bin/blackbox_register_new_file @@ -51,7 +51,7 @@ fi # VCS-independent way. IGNOREFILE=".${VCS_TYPE}ignore" if [[ $VCS_TYPE = 'git' ]]; then - ignored_file="$(echo "$unencrypted_file" | sed 's/^\([!#]\)/\\\1/')" + ignored_file="$(echo "$unencrypted_file" | sed 's/\([\*\?]\)/\\\1/g' | sed 's/^\([!#]\)/\\\1/')" if ! grep -Fsx >/dev/null "$ignored_file" "$IGNOREFILE"; then echo "$ignored_file" >>"$IGNOREFILE" COMMIT_FILES="$COMMIT_FILES $IGNOREFILE" diff --git a/tools/confidence_test.sh b/tools/confidence_test.sh index 67674a3..000cb87 100755 --- a/tools/confidence_test.sh +++ b/tools/confidence_test.sh @@ -298,6 +298,13 @@ assert_file_missing '#andpounds.txt' assert_file_exists '#andpounds.txt'.gpg assert_line_exists '\#andpounds.txt' .gitignore +PHASE 'Bob enrolls stars*bars?.txt' +echo A very commented file >'stars*bars?.txt' +blackbox_register_new_file 'stars*bars?.txt' +assert_file_missing 'stars*bars?.txt' +assert_file_exists 'stars*bars?.txt'.gpg +assert_line_exists 'stars\*bars\?.txt' .gitignore + # TODO(tlim): Add test to make sure that now alice can NOT decrypt. #