From 43d716454cb8be7098778bb6432c7dfba4ad5fa5 Mon Sep 17 00:00:00 2001 From: "Robin H. Johnson" Date: Sat, 15 Dec 2007 05:44:27 -0800 Subject: Pylint cleanup of repository.py incl refactor to util.mkdir. --- gitosis/repository.py | 14 ++++++-------- 1 file 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', -- cgit v1.2.3