Add git-archive --remote= support to gitosis-serve.
Now read access implies ability to grab archives remotely. To allow that through git-daemon (for symmetricality), run "git config --system daemon.uploadarch true".
This commit is contained in:
parent
678f196311
commit
b391399176
2 changed files with 19 additions and 0 deletions
|
@ -22,6 +22,8 @@ ALLOW_RE = re.compile("^'/*(?P<path>[a-zA-Z0-9][a-zA-Z0-9@._-]*(/[a-zA-Z0-9][a-z
|
|||
COMMANDS_READONLY = [
|
||||
'git-upload-pack',
|
||||
'git upload-pack',
|
||||
'git-upload-archive',
|
||||
'git upload-archive',
|
||||
]
|
||||
|
||||
COMMANDS_WRITE = [
|
||||
|
|
|
@ -239,6 +239,23 @@ def test_read_inits_if_needed():
|
|||
eq(os.listdir(repositories), ['foo.git'])
|
||||
assert os.path.isfile(os.path.join(repositories, 'foo.git', 'HEAD'))
|
||||
|
||||
|
||||
def test_simple_read_archive():
|
||||
tmp = util.maketemp()
|
||||
repository.init(os.path.join(tmp, 'foo.git'))
|
||||
cfg = RawConfigParser()
|
||||
cfg.add_section('gitosis')
|
||||
cfg.set('gitosis', 'repositories', tmp)
|
||||
cfg.add_section('group foo')
|
||||
cfg.set('group foo', 'members', 'jdoe')
|
||||
cfg.set('group foo', 'readonly', 'foo')
|
||||
got = serve.serve(
|
||||
cfg=cfg,
|
||||
user='jdoe',
|
||||
command="git upload-archive 'foo'",
|
||||
)
|
||||
eq(got, "git upload-archive '%s/foo.git'" % tmp)
|
||||
|
||||
def test_simple_write_dash():
|
||||
tmp = util.maketemp()
|
||||
repository.init(os.path.join(tmp, 'foo.git'))
|
||||
|
|
Loading…
Reference in a new issue