diff options
Diffstat (limited to 'project.py')
| -rw-r--r-- | project.py | 12 |
1 files changed, 12 insertions, 0 deletions
| @@ -1227,6 +1227,18 @@ class Project(object): | |||
| 1227 | self.CleanPublishedCache(all_refs) | 1227 | self.CleanPublishedCache(all_refs) |
| 1228 | revid = self.GetRevisionId(all_refs) | 1228 | revid = self.GetRevisionId(all_refs) |
| 1229 | 1229 | ||
| 1230 | # Special case the root of the repo client checkout. Make sure it doesn't | ||
| 1231 | # contain files being checked out to dirs we don't allow. | ||
| 1232 | if self.relpath == '.': | ||
| 1233 | PROTECTED_PATHS = {'.repo'} | ||
| 1234 | paths = set(self.work_git.ls_tree('-z', '--name-only', '--', revid).split('\0')) | ||
| 1235 | bad_paths = paths & PROTECTED_PATHS | ||
| 1236 | if bad_paths: | ||
| 1237 | syncbuf.fail(self, | ||
| 1238 | 'Refusing to checkout project that writes to protected ' | ||
| 1239 | 'paths: %s' % (', '.join(bad_paths),)) | ||
| 1240 | return | ||
| 1241 | |||
| 1230 | def _doff(): | 1242 | def _doff(): |
| 1231 | self._FastForward(revid) | 1243 | self._FastForward(revid) |
| 1232 | self._CopyAndLinkFiles() | 1244 | self._CopyAndLinkFiles() |
