summaryrefslogtreecommitdiff
path: root/testing/03-shallow-push.yarn
blob: ee8b4e0a1521f177a6e50f0f110c39e4217eed03 (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
<!-- -*- markdown -*- -->

Pushing from shallow clones
===========================

Git allows clones to be 'shallow' which means that they might not contain
the full history, this means that you can work with a repository even though
it might not contain everything in the history of all the refs.

    SCENARIO Pushing shallow history

    GIVEN a standard instance
     WHEN testinstance, using adminkey, clones gitano-admin.git as local-shallow with depth 1

In order to cause git to allow you to **send** it shallow content however, you
need to set `git.receive.shallowUpdate=true` in the project configuration after
the repository is created (which will set `receive.shallowUpdate=true` in the
git `config` file).

    WHEN testinstance adminkey runs create remote-shallow.git
     AND testinstance adminkey runs config remote-shallow.git set git.receive.shallowUpdate true

Once you have done that, you are permitted to push shallow content to the
repository on the Gitano server.  **NOTE** do not do this for all repositories
as it can result in information loss and even unusable git repositories if you
are not super-careful.  Also you need to be careful to handle error cases when
retrieving history if you have plugins or hooks on your Gitano server.

    WHEN testinstance, using adminkey, pushes local-shallow to remote-shallow.git
    THEN server-side remote-shallow.git file shallow exists

    FINALLY the instance is torn down