summaryrefslogtreecommitdiff
path: root/testing/02-commands-count-objects.yarn
blob: abc84d3608be724ce1979377c8ced50225bb8f2b (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
<!-- -*- markdown -*- -->

Counting objects
================

Git repositories are difficult to size without running `du` on the server-side.
But there is an accepted standard way to find out how much is in a repository
and that is to `git count-objects`.  You need to be able to read a repository
for Gitano to allow you to `count-objects` but otherwis it's fairly simple...

    SCENARIO counting objects

    GIVEN a standard instance
      AND testinstance, using adminkey, adds a new user alice, with a key called main

We can't count objects for a repository we can't read,
since that would be an information leak that the repository exists.

    WHEN alice main, expecting failure, runs count-objects gitano-admin
    THEN stderr contains CRIT: Ruleset denied action.

But if we can read the repo, then we can tell what size it is.

    WHEN testinstance adminkey runs count-objects gitano-admin
    THEN stdout contains objects
     AND stdout contains bytes

    FINALLY the instance is torn down