Skip to content

Commit 2f37201

Browse files
authored
Merge pull request presslabs#256 from PressLabs/fix-checkout-failure-242
Catch chmod exception in repository checkout. (#closes 242)
2 parents 1e01345 + ef2ba4c commit 2f37201

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

gitfs/repository.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,11 @@ def checkout(self, ref, *args, **kwargs):
111111
current_stat = os.lstat(full_path)
112112

113113
if stats['st_mode'] != current_stat.st_mode:
114-
os.chmod(full_path, current_stat.st_mode)
114+
try:
115+
os.chmod(full_path, current_stat.st_mode)
116+
except OSError:
117+
log.info("Repository: Checkout couldn't chmod %s",
118+
full_path)
115119
self._repo.index.add(self._sanitize(path))
116120

117121
return result

0 commit comments

Comments
 (0)