diff options
| author | Shawn O. Pearce <sop@google.com> | 2008-10-29 14:38:12 -0700 |
|---|---|---|
| committer | Shawn O. Pearce <sop@google.com> | 2008-10-29 14:38:12 -0700 |
| commit | de646819b8e43a906d86a579c68118cad31934cc (patch) | |
| tree | 2133f50781f6849d3f8de8ae3a95b5a6c1853063 | |
| parent | bd4edc9a6996d666edfa77b6b80615ee7c8ea335 (diff) | |
| download | git-repo-de646819b8e43a906d86a579c68118cad31934cc.tar.gz | |
Don't flip out if there are no template hooks
Git may have been installed without its hooks directory, which
means we won't have any hooks in a repo created git repository.
Since we are just deleting the hooks it doesn't matter.
Signed-off-by: Shawn O. Pearce <sop@google.com>
| -rw-r--r-- | project.py | 6 |
1 files changed, 5 insertions, 1 deletions
| @@ -775,7 +775,11 @@ class Project(object): | |||
| 775 | self.config.SetString('core.bare', None) | 775 | self.config.SetString('core.bare', None) |
| 776 | 776 | ||
| 777 | hooks = self._gitdir_path('hooks') | 777 | hooks = self._gitdir_path('hooks') |
| 778 | for old_hook in os.listdir(hooks): | 778 | try: |
| 779 | to_rm = os.listdir(hooks) | ||
| 780 | except OSError: | ||
| 781 | to_rm = [] | ||
| 782 | for old_hook in to_rm: | ||
| 779 | os.remove(os.path.join(hooks, old_hook)) | 783 | os.remove(os.path.join(hooks, old_hook)) |
| 780 | 784 | ||
| 781 | # TODO(sop) install custom repo hooks | 785 | # TODO(sop) install custom repo hooks |
