Better handle filenames with * and ? in them.
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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.
|
||||
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user