diff options
author | milki <milki@rescomp.berkeley.edu> | 2014-07-25 11:07:02 -0700 |
---|---|---|
committer | Sitaram Chamarty <sitaram@atc.tcs.com> | 2015-11-26 20:25:21 +0530 |
commit | e430ba6249ba32824a7155928c6cc4b019e75985 (patch) | |
tree | b18c520269f2dc465f664773bb1d8818176bc77f /t | |
parent | new mirror function: 'status all all' (diff) | |
download | gitolite-gentoo-e430ba6249ba32824a7155928c6cc4b019e75985.tar.gz gitolite-gentoo-e430ba6249ba32824a7155928c6cc4b019e75985.tar.bz2 gitolite-gentoo-e430ba6249ba32824a7155928c6cc4b019e75985.zip |
Enter trigger create-with-reference
On repo creation, setup objects/info/alternates for a server side
alternate object store. The value is configured via `option
reference.repo`.
Intended to use with forks and mirrors to save network bandwidth.
Diffstat (limited to 't')
-rwxr-xr-x | t/reference.t | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/t/reference.t b/t/reference.t new file mode 100755 index 0000000..fefb5bc --- /dev/null +++ b/t/reference.t @@ -0,0 +1,48 @@ +#!/usr/bin/perl +use strict; +use warnings; + +# this is hardcoded; change it if needed +use lib "src/lib"; +use Gitolite::Test; +my $h = $ENV{HOME}; + +# fork command +# ---------------------------------------------------------------------- + +try "plan 16"; + +my $rb = `gitolite query-rc -n GL_REPO_BASE`; + +try "sed -ie 's%.Mirroring.,%\"Mirroring\",\\n\"create-with-reference\",%' ~/.gitolite.rc"; + +confreset;confadd ' + + repo source + RW+ = u1 u2 + + repo fork + RW+ = u1 u2 + option reference.repo = source + + repo multifork + RW+ = u1 u2 + option reference.repo-1 = source + option reference.repo-2 = fork +'; + +try "ADMIN_PUSH set1; !/FATAL/" or die text(); + +try " # Verify files + # source doesn't have alternates + ls $rb/source.git/objects/info/alternates; !ok + + # fork has source as an alternate + ls $rb/fork.git/objects/info/alternates; ok + cat $rb/fork.git/objects/info/alternates; ok; /$rb/source.git/objects/ + + # multifork has multiple alternates + ls $rb/multifork.git/objects/info/alternates; ok + cat $rb/multifork.git/objects/info/alternates; ok; /$rb/source.git/objects/ + /$rb/fork.git/objects/ +"; |