Make accept_snapshot() work on filenames containing a dot (#1669) #2029
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This changes slightly the logic for matching file names:
before if a file name was considered to be without extension, we would add the
.md
and then compare it with the actual file names in the_snaps
directory. However, that would fail if the file contained dots, as they would be considered to be a file extension: for them no.md
was added to their name, and therefore they would never match with the actual files in the_snaps
directory, so no update could ever succeedwith this patch, we strip any
.md
or.txt
extension from the file names thatsnapshot_manage()
receives, and compare those with the actual file names from the_snaps
directory also without extensionI've added tests and a NEWS item (all tests pass locally).
Fixes #1669.