Possible issue with new git implementation and empty folders

Just posting this quickly as I need to do more cleanup, but I was alerted to an issue this morning that stems from empty folders being removed from production docker container during a recent push.

If I recall correctly, a new git library is now in use, so just alerting here that empty folders MAY be removed in some circumstances.

I'll follow up later after I have time to properly diagnose.

it is not completely a new git library, but we started to gradually implement using git from the command line.

Currently it is only being used in in the git cleanup /discard changes action.

Is it there where you experience the removal of empty folders? So you are discarding all changes?

I just did a test, and yes it looks like when using the Discard all changes button, it also removes empty folders.

Yes but that is default git behavior, folders by them selves are never stored in git only files with paths.

So if you have an empty folder it won’t be stored.

If you really want to keep it create a dummy file inside

Okay, so a new behavior (these empty folders are a couple years old and I use discard all changes often) but I can easily add dummy files.

Untracked files are not tampered (deleted)

ChatGPT:
In Git, discarding changes (like with git restore or git checkout --) only affects tracked files, and Git by default does not track empty folders. Here’s how it works:
• Empty folders are not tracked by Git — Git tracks files, not directories. If a folder has no tracked files in it, Git doesn’t know or care about it.
• Therefore, discarding changes won’t remove empty folders, because those folders aren’t under Git’s control to begin with.
• If a folder had tracked files that you deleted, and you then discard that deletion, the files will come back — and so will the folder, since it will no longer be empty.