merger: ensure .git/refs is not removed as a leaked dirs
This change ensures the .git/refs directory is not removed as this prevents further git operation. Change-Id: Ia314103d6807b755de3cf11eb7e7d4151626326f
This commit is contained in:
parent
ccddc37fa0
commit
769ecde8fc
|
@ -310,7 +310,7 @@ class Repo(object):
|
||||||
def _cleanup_leaked_ref_dirs(local_path, log, messages):
|
def _cleanup_leaked_ref_dirs(local_path, log, messages):
|
||||||
for root, dirs, files in os.walk(
|
for root, dirs, files in os.walk(
|
||||||
os.path.join(local_path, '.git/refs'), topdown=False):
|
os.path.join(local_path, '.git/refs'), topdown=False):
|
||||||
if not os.listdir(root):
|
if not os.listdir(root) and not root.endswith('.git/refs'):
|
||||||
if log:
|
if log:
|
||||||
log.debug("Cleaning empty ref dir %s", root)
|
log.debug("Cleaning empty ref dir %s", root)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue