blob: 17a88182689304c222f8e3c2b61372513017f0e4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
import os import subprocess from gitosis import util def init( path, template=None, _git=None, ): if _git is None: _git = 'git' util.mkdir(path, 0750) args = [_git, 'init'] if template is not None: args.append('--template=%s' % template) env = {} env.update(os.environ) env['GIT_DIR'] = '.' returncode = subprocess.call( args=args, cwd=path, close_fds=True, env=env, ) if returncode != 0: raise RuntimeError( ("Command '%r' returned non-zero exit status %d" % (args, returncode)), )
|