Include empty directories in the default state of acceptance tests #11268
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.
Before each scenario of the acceptance tests is run the Nextcloud server is reset to a default state. To do this the full directory of the Nextcloud server is commited to a local Git repository and then reset to that commit when needed.
Unfortunately, Git does not support including empty directories in a commit. Due to this, when the default state was restored, it could happen that the file cache listed an empty directory that did not exist because it was not properly restored (for example,
data/appdata_*/css/icons
), and that in turn could lead to an error when the directory was used.Currently the only way to force Git to include an empty directory is to add a dummy file to the directory (so it will no longer be empty, but that should not be a problem in the affected directories, even if the dummy file is not included in the file cache); although Git FAQ suggests using a .gitignore file a .keep file was used instead, as it conveys better its purpose.