A .gitkeep file should be added to directories when all files are deleted in the Web IDE
Problem to solve
Currently if a user deletes all the files in a directory and commits + pushes that change the directory will no longer be tracked in Git (this is by design as Git does not track directories). This means that upon re-visitng the project view or re-opening the Web IDE the directory will be missing.
Intended users
Anyone who uses the Web IDE and makes multiple file edits inside of a directory.
Further details
In https://gitlab.com/gitlab-org/gitlab-ce/issues/60860 directories were left in the Web IDE so that after all files were removed additional files could be uploaded to the same directory in the same session. Demo can be seen in the MR https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/29196.
This does not retain the directory on a new session or in the project if the Web IDE session is closed.
Proposal
Based on conversation in https://gitlab.com/gitlab-org/gitlab-ce/issues/64677#note_195127845 it makes sense to add a .gitkeep file to the empty directory if all files are deleted to preserve the directory in the file tree.