diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2007-12-15 05:44:27 -0800 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2007-12-18 01:12:21 -0800 |
commit | 43d716454cb8be7098778bb6432c7dfba4ad5fa5 (patch) | |
tree | 7a306bbfb912cc9920c74ae9190efa699c7e88a4 /gitosis | |
parent | Pylint cleanup. (diff) | |
download | gitosis-dakkar-43d716454cb8be7098778bb6432c7dfba4ad5fa5.tar.gz gitosis-dakkar-43d716454cb8be7098778bb6432c7dfba4ad5fa5.tar.bz2 gitosis-dakkar-43d716454cb8be7098778bb6432c7dfba4ad5fa5.zip |
Pylint cleanup of repository.py incl refactor to util.mkdir.
Diffstat (limited to 'gitosis')
-rw-r--r-- | gitosis/repository.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/gitosis/repository.py b/gitosis/repository.py index 07e657d..47ebc1e 100644 --- a/gitosis/repository.py +++ b/gitosis/repository.py @@ -1,4 +1,6 @@ -import errno +""" +Gitosis functions for dealing with Git repositories. +""" import os import re import subprocess @@ -121,13 +123,8 @@ class GitCheckoutIndexError(GitExportError): """git checkout-index failed""" def export(git_dir, path): - try: - os.mkdir(path) - except OSError, e: - if e.errno == errno.EEXIST: - pass - else: - raise + """Export a Git repository to a given path.""" + util.mkdir(path) returncode = subprocess.call( args=[ 'git', @@ -166,6 +163,7 @@ class GitRevParseError(GitError): """rev-parse failed""" def has_initial_commit(git_dir): + """Check if a Git repo contains at least one commit linked by HEAD.""" child = subprocess.Popen( args=[ 'git', |