summaryrefslogtreecommitdiffstats
path: root/t/reference.t
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 09:55:51 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 09:55:51 +0000
commit7685305e1f82212323ec32a321b1f5c623751b6c (patch)
treea1af617672e26aee4c1031a3aa83e8ff08f6a0a5 /t/reference.t
parentInitial commit. (diff)
downloadgitolite3-7685305e1f82212323ec32a321b1f5c623751b6c.tar.xz
gitolite3-7685305e1f82212323ec32a321b1f5c623751b6c.zip
Adding upstream version 3.6.12.upstream/3.6.12upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 't/reference.t')
-rwxr-xr-xt/reference.t48
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/
+";