author | Shawn Pearce <spearce@spearce.org> | |
Fri, 17 Feb 2006 07:26:16 +0000 (02:26 -0500) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sat, 18 Feb 2006 07:52:57 +0000 (23:52 -0800) | ||
commit | 772d8a3b63ff669c285edb8aff0c63b609614933 | |
tree | 9fdefe7143865b57b4ea1231979a21b1cc3dbdba | tree | snapshot |
parent | 735d80b3bf1be9513d030e61af1ef6512cec015a | commit | diff |
Make git-reset delete empty directories
When git-reset --hard is used and a subdirectory becomes
empty (as it contains no tracked files in the target tree)
the empty subdirectory should be removed. This matches
the behavior of git-checkout-index and git-read-tree -m
which would not have created the subdirectory or would
have deleted it when updating the working directory.
Subdirectories which are not empty will be left behind.
This may happen if the subdirectory still contains object
files from the user's build process (for example).
[jc: simplified the logic a bit, while keeping the test script.]
When git-reset --hard is used and a subdirectory becomes
empty (as it contains no tracked files in the target tree)
the empty subdirectory should be removed. This matches
the behavior of git-checkout-index and git-read-tree -m
which would not have created the subdirectory or would
have deleted it when updating the working directory.
Subdirectories which are not empty will be left behind.
This may happen if the subdirectory still contains object
files from the user's build process (for example).
[jc: simplified the logic a bit, while keeping the test script.]
git-reset.sh | diff | blob | history | |
t/t7101-reset.sh | [new file with mode: 0755] | blob |