summaryrefslogtreecommitdiff
path: root/testing/02-commands-create.yarn
blob: d83326e80b7f0cf1959c26ae180d1e492b238df1 (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
32
33
34
35
36
37
38
39
40
41
42
<!-- -*- markdown -*- -->

Creating repositories
=====================

It is an essential part of a Git server that the user of the server can be
permitted to create repositories.  Sometimes this is restricted to an
administrator user of some kind, and other times parts of the namespace may be
delegated to different users.

    SCENARIO user-created repositories

    GIVEN a standard instance
      AND testinstance using adminkey has patched gitano-admin with personal-repo-create.patch
      AND testinstance, using adminkey, adds a new user alice, with a key called main
     WHEN alice main runs create personal/alice/testrepo
      AND alice main runs config personal/alice/testrepo show
     THEN stderr is empty
      AND stdout contains project.owner: alice

If the ACLs do not permit it, then the user is given a direct but
comprehensible error message to that effect.

    WHEN alice main, expecting failure, runs create personal/testintance/testrepo
    THEN stderr contains CRIT: Repository creation is not permitted.

    FINALLY the instance is torn down

When creating a repository, we update the HTTP server information file because
that way gitweb and the like don't get upset even if nothing has been pushed,
and HTTP smart access can be permitted, which might be necessary for the push
in the first place.

    SCENARIO created repositories have server info

    GIVEN a standard instance

    WHEN testinstance adminkey runs create foobar
    THEN server-side foobar.git file objects/info/packs exists
     AND server-side foobar.git file info/refs exists

    FINALLY the instance is torn down