diff options
author | Guido Günther <agx@sigxcpu.org> | 2012-03-19 14:29:02 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2012-03-19 14:35:17 +0100 |
commit | de59214f08fbbd87810ff7890c4d681d9b953702 (patch) | |
tree | 95acbba799673d11c3425e066336441979eaf735 /gbp | |
parent | 2e783283984d7413d7adeab66e91a1beb83e8ada (diff) |
GitRepository.create(): use GitArgs
Git-Dch: Ignore
Diffstat (limited to 'gbp')
-rw-r--r-- | gbp/git/repository.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/gbp/git/repository.py b/gbp/git/repository.py index 03b166c..96afc5a 100644 --- a/gbp/git/repository.py +++ b/gbp/git/repository.py @@ -1275,22 +1275,21 @@ class GitRepository(object): @param path: where to create the repository @type path: C{str} + @param bare: whether to create a bare repository + @type bare: C{bool} @return: git repository object @rtype: L{GitRepository} """ + args = GitArgs() abspath = os.path.abspath(path) - if bare: - args = [ '--bare' ] - git_dir = '' - else: - args = [] - git_dir = '.git' + args.add_true(bare, '--bare') + git_dir = '' if bare else '.git' try: if not os.path.exists(abspath): os.makedirs(abspath) - GitCommand("init", args, cwd=abspath)() + GitCommand("init", args.args, cwd=abspath)() if description: with file(os.path.join(abspath, git_dir, "description"), 'w') as f: description += '\n' if description[-1] != '\n' else '' |