diff options
author | mbohy <matt.bohy@protonmail.com> | 2023-01-28 19:42:46 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-28 20:42:46 +0100 |
commit | f848aaf02ab0cb9a41cef3f457c45a93e2265d76 (patch) | |
tree | 3bd6f56e958dbe78612d06243811dae8b75a02a0 /storage | |
parent | 5dabd83e3712e2554745c736b55df405a0ba4f33 (diff) | |
download | go-git-f848aaf02ab0cb9a41cef3f457c45a93e2265d76.tar.gz |
git: worktree: check for empty parent dirs during Reset (Fixes #670) (#671)
When we delete dir1/dir2/file1, we currently check if dir2 becomes
empty with the deletion of file1, and if so, we delete dir2. If
dir1 becomes empty with the deletion of dir2, we don't notice that,
and dir1 is left behind.
This commit adds a loop to check each parent directory in the file
path for emptiness, removing empty directories along the way until
a non-empty directory is found (or an error occurs).
Diffstat (limited to 'storage')
0 files changed, 0 insertions, 0 deletions