bisect-kit: fix bug: cannot remove symlink when cleanup
BUG=None
TEST=manually
Change-Id: I871a5f9456f564b7e37c45f2ec3bb3748b758ae0
diff --git a/bisect_kit/git_util.py b/bisect_kit/git_util.py
index b783145..282e87b 100644
--- a/bisect_kit/git_util.py
+++ b/bisect_kit/git_util.py
@@ -490,7 +490,9 @@
for untracked in list_untracked(git_repo, excludes=excludes):
path = os.path.join(git_repo, untracked)
logger.debug('delete untracked: %s', path)
- if os.path.isdir(path):
+ if os.path.islink(path):
+ os.unlink(path)
+ elif os.path.isdir(path):
shutil.rmtree(path)
else:
os.unlink(path)