Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

make REPO_BASE absolute early

$ENV{GL_REPO_BASE_ABS} is meant to point to the same directory as
$REPO_BASE, except it is meant to be passed to hooks, ADCs and other
child programs.  And since you can't be sure where the child program
starts in, this became an absolute path.

Gradually, however, I started using it wherever I needed an absolute
path (mostly in code that jumps around various directories to do stuff).
Which is silly, because there's no reason $REPO_BASE cannot also be made
an absolute, even if the rc file has a relative path.

So that's what I did now: made $REPO_BASE absolute very early on, and
then systematically changed all uses of the longer form to the shorter
form when appropriate.  And so the only thing we now use the longer one
for is to pass to child programs.

(Implementation note: The actual change is not very big, but while I was
about it I decided to make the test suite able to test with an absolute
REPO_BASE also, which is why the commit seems so large.)

----

This all started with a complaint from Damien Regad.  He had an
extremely odd setup where his bashrc changed PWD to something other than
$HOME before anything else ran.  This caused those two variables to
beceom inconsistent, and he had a 1-line fix he wanted me to apply.

I generally don't like making special fixes for for non-standard setups,
and anyway all he had to do was set the full path to REPO_BASE in the rc
file to get around this.  Which is what I told him and he very politely
left it at that.

However, this did get me thinking, and I soon realised I was needlessly
conflating "relative versus absolute" with "able to be passed to child
programs".  Fixing that solved his problem also, as a side-effect.

So I guess this is all thanks to Damien!
  • Loading branch information...
commit 6539009cb5eb9295452a2588c8aad1171055b431 1 parent 85fe9c1
Sitaram Chamarty authored

Showing 31 changed files with 158 additions and 151 deletions. Show diff stats Hide diff stats

  1. +14 12 src/gitolite.pm
  2. +3 0  src/gitolite_rc.pm
  3. +3 3 src/gl-auth-command
  4. +4 8 src/gl-compile-conf
  5. +2 6 src/gl-install
  6. +3 1 t/install-gitolite
  7. +4 4 t/out/t01-repo-groups.1bs
  8. +2 2 t/out/t01-repo-groups.2
  9. +3 3 t/out/t02-user-groups.1bs
  10. +3 3 t/out/t02-user-groups.2bs
  11. +2 1  t/rollback.server
  12. +1 1  t/t00-initial
  13. +3 3 t/t04a-wild-all
  14. +1 1  t/t04a-wild-students
  15. +1 1  t/t05a-delegation
  16. +1 1  t/t50-sequence-test
  17. +1 1  t/t53-check-info-expand-output
  18. +4 4 t/t54-repo-configs
  19. +7 7 t/t55-repo-configs-wild-without-CREATOR
  20. +7 7 t/t56-repo-configs-wild-with-CREATOR
  21. +15 15 t/t57-daemon-gitweb
  22. +17 17 t/t58-daemon-gitweb-wild
  23. +5 5 t/t59-repo-not-on-disk
  24. +25 25 t/t60-daemon-gitweb-via-setperms
  25. +1 1  t/t61-setperms-groups
  26. +2 2 t/t62-rule-sequences
  27. +1 1  t/t63-perm-cats
  28. +8 8 t/t64-write-able
  29. +4 4 t/t67-hub
  30. +10 4 t/test-driver.sh
  31. +1 0  t/update-gitolite
26 src/gitolite.pm
@@ -171,7 +171,7 @@ sub list_phy_repos
171 171 {
172 172 my @phy_repos;
173 173
174   - wrap_chdir("$ENV{GL_REPO_BASE_ABS}");
  174 + wrap_chdir($REPO_BASE);
175 175 for my $repo (`find . -type d -name "*.git" -prune`) {
176 176 chomp ($repo);
177 177 $repo =~ s(\./(.*)\.git$)($1);
@@ -250,7 +250,7 @@ sub new_repo
250 250 sub new_wild_repo {
251 251 my ($repo, $user) = @_;
252 252
253   - wrap_chdir("$ENV{GL_REPO_BASE_ABS}");
  253 + wrap_chdir($REPO_BASE);
254 254 new_repo($repo, "$GL_ADMINDIR/hooks/common", $user);
255 255 # note pwd is now the bare "repo.git"; new_repo does that...
256 256 wrap_print("gl-perms", "$GL_WILDREPOS_DEFPERMS\n") if $GL_WILDREPOS_DEFPERMS;
@@ -294,8 +294,8 @@ sub new_wild_repo {
294 294
295 295 # creator
296 296 my $c = '';
297   - if ( -f "$ENV{GL_REPO_BASE_ABS}/$repo.git/gl-creater") {
298   - my $fh = wrap_open("<", "$ENV{GL_REPO_BASE_ABS}/$repo.git/gl-creater");
  297 + if ( -f "$REPO_BASE/$repo.git/gl-creater") {
  298 + my $fh = wrap_open("<", "$REPO_BASE/$repo.git/gl-creater");
299 299 chomp($c = <$fh>);
300 300 }
301 301
@@ -308,8 +308,8 @@ sub new_wild_repo {
308 308 # "WRITERS=>foo" and "TESTERS=>@all"
309 309 my %perm_cats;
310 310
311   - if ($user and -f "$ENV{GL_REPO_BASE_ABS}/$repo.git/gl-perms") {
312   - my $fh = wrap_open("<", "$ENV{GL_REPO_BASE_ABS}/$repo.git/gl-perms");
  311 + if ($user and -f "$REPO_BASE/$repo.git/gl-perms") {
  312 + my $fh = wrap_open("<", "$REPO_BASE/$repo.git/gl-perms");
313 313 my $perms = join ("", <$fh>);
314 314 # discard comments
315 315 $perms =~ s/#.*//g;
@@ -353,7 +353,7 @@ sub get_set_perms
353 353 $GL_WILDREPOS_PERM_CATS ||= "READERS WRITERS";
354 354 my ($creator, $dummy, $dummy2) = wild_repo_rights($repo, "");
355 355 die "$repo doesnt exist or is not yours\n" unless $user eq $creator;
356   - wrap_chdir("$ENV{GL_REPO_BASE_ABS}");
  356 + wrap_chdir($REPO_BASE);
357 357 wrap_chdir("$repo.git");
358 358 if ($verb eq 'getperms') {
359 359 return unless -f "gl-perms";
@@ -390,7 +390,7 @@ sub get_set_desc
390 390 my($repo, $verb, $user) = @_;
391 391 my ($creator, $dummy, $dummy2) = wild_repo_rights($repo, "");
392 392 die "$repo doesnt exist or is not yours\n" unless $user eq $creator;
393   - wrap_chdir("$ENV{GL_REPO_BASE_ABS}");
  393 + wrap_chdir($REPO_BASE);
394 394 wrap_chdir("$repo.git");
395 395 if ($verb eq 'getdesc') {
396 396 print slurp("description") if -f "description";
@@ -562,7 +562,7 @@ sub expand_wild
562 562 # display matching repos (from *all* the repos in the system) that $user
563 563 # has at least "R" access to
564 564
565   - chdir("$ENV{GL_REPO_BASE_ABS}") or die "chdir $ENV{GL_REPO_BASE_ABS} failed: $!\n";
  565 + chdir($REPO_BASE) or die "chdir $REPO_BASE failed: $!\n";
566 566 my $count = 0;
567 567 for my $actual_repo (`find . -type d -name "*.git" -prune|sort`) {
568 568 chomp ($actual_repo);
@@ -665,7 +665,7 @@ sub add_repo_conf
665 665 {
666 666 my ($repo) = shift;
667 667 return unless $split_conf{$repo};
668   - do "$ENV{GL_REPO_BASE_ABS}/$repo.git/gl-conf" or return;
  668 + do "$REPO_BASE/$repo.git/gl-conf" or return;
669 669 $repos{$repo} = $one_repo{$repo};
670 670 $git_configs{$repo} = $one_git_config{$repo};
671 671 }
@@ -694,6 +694,8 @@ sub add_repo_conf
694 694 # means we've been called from outside; see doc/admin-defined-commands.mkd
695 695 where_is_rc();
696 696 die "parse $ENV{GL_RC} failed: " . ($! or $@) unless do $ENV{GL_RC};
  697 + # fix up REPO_BASE
  698 + $REPO_BASE = "$ENV{HOME}/$REPO_BASE" unless $REPO_BASE =~ m(^/);
697 699 }
698 700
699 701 my $perm = ' ';
@@ -701,7 +703,7 @@ sub add_repo_conf
701 703
702 704 # get basic info about the repo and fill %repos
703 705 my $wild = '';
704   - my $exists = -d "$ENV{GL_REPO_BASE_ABS}/$repo.git";
  706 + my $exists = -d "$REPO_BASE/$repo.git";
705 707 if ($exists) {
706 708 # the list of permission categories within gl-perms that this user is a member
707 709 # of, or that specify @all as a member. See comments in
@@ -768,7 +770,7 @@ sub can_read {
768 770 # helper to manage "disabling" a repo or the whole site for "W" access
769 771 sub check_repo_write_enabled {
770 772 my ($repo) = shift;
771   - for my $d ("$ENV{HOME}/.gitolite.down", "$ENV{GL_REPO_BASE_ABS}/$repo.git/.gitolite.down") {
  773 + for my $d ("$ENV{HOME}/.gitolite.down", "$REPO_BASE/$repo.git/.gitolite.down") {
772 774 next unless -f $d;
773 775 die $ABRT . slurp($d) if -s $d;
774 776 die $ABRT . "writes are currently disabled\n";
3  src/gitolite_rc.pm
@@ -65,6 +65,9 @@ for ("$ENV{HOME}/.gitolite.rc", "/etc/gitolite/gitolite.rc") {
65 65 die "no rc file found\n" unless $ENV{GL_RC};
66 66 do $ENV{GL_RC} or die "error parsing $ENV{GL_RC}\n";
67 67
  68 +# fix up REPO_BASE
  69 +$REPO_BASE = "$ENV{HOME}/$REPO_BASE" unless $REPO_BASE =~ m(^/);
  70 +
68 71 # ------------------------------------------------------------------------------
69 72 # per perl rules, this should be the last line in such a file:
70 73 1;
6 src/gl-auth-command
@@ -142,7 +142,7 @@ $ENV{GL_REPO}=$repo;
142 142 # first level permissions check
143 143
144 144 my ($perm, $creator, $wild);
145   -if ( $GL_ALL_READ_ALL and $verb =~ $R_COMMANDS and -d "$ENV{GL_REPO_BASE_ABS}/$repo.git") {
  145 +if ( $GL_ALL_READ_ALL and $verb =~ $R_COMMANDS and -d "$REPO_BASE/$repo.git") {
146 146 $perm = 'R';
147 147 } else {
148 148 ($perm, $creator, $wild) = repo_rights($repo);
@@ -164,8 +164,8 @@ check_repo_write_enabled($repo) if $aa eq 'W';
164 164 # get confused, in case the code in the pre-git hook forgot. To make it
165 165 # simple for the script, send in $aa (which will be 'R' or 'W') so now they
166 166 # have all three: GL_USER and GL_REPO in the env, and $aa as arg-1.
167   -if (-x "$ENV{GL_REPO_BASE_ABS}/$repo.git/hooks/gl-pre-git") {
168   - system("cd $ENV{GL_REPO_BASE_ABS}/$repo.git; hooks/gl-pre-git $aa >&2");
  167 +if (-x "$REPO_BASE/$repo.git/hooks/gl-pre-git") {
  168 + system("cd $REPO_BASE/$repo.git; hooks/gl-pre-git $aa >&2");
169 169 die "gl-pre-git hook failed ($?)\n" if $?;
170 170 }
171 171
12 src/gl-compile-conf
@@ -383,10 +383,6 @@ die "\n\t\t***** AAARGH! *****\n" .
383 383 # doc/big-config.mkd for details.
384 384 # ----------------------------------------------------------------------------
385 385
386   -# repo-base needs to be an absolute path due to all the jumping around we do,
387   -# so if it was not already absolute, prefix $HOME.
388   -$ENV{GL_REPO_BASE_ABS} = ( $REPO_BASE =~ m(^/) ? $REPO_BASE : "$ENV{HOME}/$REPO_BASE" );
389   -
390 386 # process the normal repos in %repos. This includes creating them if needed
391 387 # (and GL_NO_CREATE_REPOS is not set), checking hooks, and finally, if
392 388 # GL_BIG_CONFIG is set, writing out the one-repo config file for directly
@@ -400,7 +396,7 @@ write_compiled_conf(); # write out the final compiled config
400 396
401 397 sub do_normal_repos
402 398 {
403   - wrap_chdir("$ENV{GL_REPO_BASE_ABS}");
  399 + wrap_chdir($REPO_BASE);
404 400
405 401 # start with the ones that are normal repos in %repos
406 402 my @repos = grep { $_ =~ $REPONAME_PATT and not /^@/ } sort keys %repos;
@@ -419,7 +415,7 @@ sub do_normal_repos
419 415 print STDERR "creating $repo...\n";
420 416 new_repo($repo, "$GL_ADMINDIR/hooks/common");
421 417 # new_repo would have chdir'd us away; come back
422   - wrap_chdir("$ENV{GL_REPO_BASE_ABS}");
  418 + wrap_chdir($REPO_BASE);
423 419 }
424 420
425 421 # when repos are copied over from elsewhere, one had to run easy install
@@ -520,13 +516,13 @@ my %projlist = ();
520 516 # sub parse_acl (look for variable $saved_crwu)
521 517
522 518 for my $repo (@phy_repos) {
523   - wrap_chdir("$ENV{GL_REPO_BASE_ABS}/$repo.git");
  519 + wrap_chdir("$REPO_BASE/$repo.git");
524 520 # daemon is easy
525 521 setup_daemon_access($repo);
526 522 }
527 523
528 524 for my $repo (@phy_repos) {
529   - wrap_chdir("$ENV{GL_REPO_BASE_ABS}/$repo.git");
  525 + wrap_chdir("$REPO_BASE/$repo.git");
530 526 # gitweb is a little more complicated. Here're some notes:
531 527 # - "setup_gitweb_access" also sets "owner", despite the name
532 528 # - specifying a description also counts as enabling gitweb
8 src/gl-install
@@ -53,9 +53,6 @@ unless ($ENV{GL_RC}) {
53 53 exit;
54 54 }
55 55
56   -# ok now the rc file exists; read it to get the other paths
57   -die "parse $ENV{GL_RC} failed: " . ($! or $@) unless do $ENV{GL_RC};
58   -
59 56 # add a custom path for git binaries, if specified
60 57 $ENV{PATH} .= ":$GIT_PATH" if $GIT_PATH;
61 58
@@ -63,8 +60,7 @@ $ENV{PATH} .= ":$GIT_PATH" if $GIT_PATH;
63 60 umask($REPO_UMASK);
64 61
65 62 # mkdir $REPO_BASE, $GL_ADMINDIR if they don't already exist
66   -$ENV{GL_REPO_BASE_ABS} = ( $REPO_BASE =~ m(^/) ? $REPO_BASE : "$ENV{HOME}/$REPO_BASE" );
67   -wrap_mkdir($ENV{GL_REPO_BASE_ABS});
  63 +wrap_mkdir($REPO_BASE);
68 64 wrap_mkdir($GL_ADMINDIR, 0700);
69 65 # mkdir $GL_ADMINDIR's subdirs
70 66 for my $dir qw(conf doc keydir logs src hooks hooks/common hooks/gitolite-admin) {
@@ -93,7 +89,7 @@ EOF
93 89 }
94 90
95 91 # finally, hooks must be propagated to all the repos in case they changed
96   -chdir("$ENV{GL_REPO_BASE_ABS}") or die "chdir $ENV{GL_REPO_BASE_ABS} failed: $!\n";
  92 +chdir($REPO_BASE) or die "chdir $REPO_BASE failed: $!\n";
97 93 for my $repo (`find . -type d -name "*.git" -prune`) {
98 94 chomp ($repo);
99 95 # propagate our own, plus any local admin-defined, hooks
4 t/install-gitolite
@@ -16,7 +16,7 @@ chmod 600 ~/.ssh/u?
16 16
17 17 # blank out the server side
18 18 echo the next command MAY ask for a password
19   -ssh gitolite-test@localhost rm -rf .ssh .gitolite .gitolite.rc repositories gitolite-install
  19 +ssh gitolite-test@localhost rm -rf .ssh .gitolite .gitolite.rc repositories gitolite-install /tmp/glrb
20 20 echo the next command SHOULD ask for a password
21 21 ssh-copy-id -i ~/.ssh/id_rsa gitolite-test@localhost
22 22 echo the next command should NOT ask for a password
@@ -33,4 +33,6 @@ git push
33 33 # make the rollback.tar files on both sides
34 34 cd
35 35 tar cf rollback.tar gitolite-admin
  36 +ssh gitolite-test@localhost mkdir -p repositories /tmp/glrb
36 37 ssh gitolite-test@localhost tar cf rollback.tar .ssh .gitolite .gitolite.rc repositories gitolite-install
  38 +ssh gitolite-test@localhost tar -C /tmp -cf \$HOME/rollback2.tar glrb
8 t/out/t01-repo-groups.1bs
@@ -6,10 +6,10 @@ $data_version = '1.7';
6 6 'gitolite-admin' => 1,
7 7 'testing' => 1
8 8 );
9   -repositories/aa.git/gl-conf
10   -repositories/bb.git/gl-conf
11   -repositories/gitolite-admin.git/gl-conf
12   -repositories/testing.git/gl-conf
  9 +./aa.git/gl-conf
  10 +./bb.git/gl-conf
  11 +./gitolite-admin.git/gl-conf
  12 +./testing.git/gl-conf
13 13 %one_repo = (
14 14 'aa' => {
15 15 'R' => {
4 t/out/t01-repo-groups.2
@@ -35,8 +35,8 @@ $data_version = '1.7';
35 35 'gitolite-admin' => 1,
36 36 'testing' => 1
37 37 );
38   -repositories/gitolite-admin.git/gl-conf
39   -repositories/testing.git/gl-conf
  38 +./gitolite-admin.git/gl-conf
  39 +./testing.git/gl-conf
40 40 %one_repo = (
41 41 'gitolite-admin' => {
42 42 'R' => {
6 t/out/t02-user-groups.1bs
@@ -5,9 +5,9 @@ $data_version = '1.7';
5 5 'gitolite-admin' => 1,
6 6 'testing' => 1
7 7 );
8   -repositories/aa.git/gl-conf
9   -repositories/gitolite-admin.git/gl-conf
10   -repositories/testing.git/gl-conf
  8 +./aa.git/gl-conf
  9 +./gitolite-admin.git/gl-conf
  10 +./testing.git/gl-conf
11 11 %one_repo = (
12 12 'aa' => {
13 13 'R' => {
6 t/out/t02-user-groups.2bs
@@ -19,9 +19,9 @@ $data_version = '1.7';
19 19 'gitolite-admin' => 1,
20 20 'testing' => 1
21 21 );
22   -repositories/aa.git/gl-conf
23   -repositories/gitolite-admin.git/gl-conf
24   -repositories/testing.git/gl-conf
  22 +./aa.git/gl-conf
  23 +./gitolite-admin.git/gl-conf
  24 +./testing.git/gl-conf
25 25 %one_repo = (
26 26 'aa' => {
27 27 '@g1' => [
3  t/rollback.server
... ... @@ -1,8 +1,9 @@
1 1 #!/bin/bash
2 2
3 3 cd
4   -rm -rf .ssh .gitolite .gitolite.rc repositories gitolite-install
  4 +rm -rf .ssh .gitolite .gitolite.rc repositories gitolite-install /tmp/glrb
5 5 tar xf rollback.tar
  6 +( cd /tmp; tar xf ~/rollback2.tar )
6 7
7 8 # if arg1 is a directory, we have to overwrite sources from there (see commit
8 9 # message for details)
2  t/t00-initial
@@ -13,7 +13,7 @@ expect "To gitolite:gitolite-admin"
13 13 expect "master -> master"
14 14
15 15 name "basic create repo"
16   -expect "remote: Initialized empty Git repository in /home/gitolite-test/repositories/aa.git/"
  16 +expect "remote: Initialized empty Git repository in $TEST_BASE_FULL/aa.git/"
17 17
18 18 # ----------
19 19 name "basic clone"
6 t/t04a-wild-all
@@ -22,12 +22,12 @@ cd ~/td
22 22
23 23 name "u1 create success"
24 24 runlocal git clone u1:foo/u1/a01
25   -expect "Initialized empty Git repository in /home/gitolite-test/repositories/foo/u1/a01.git/"
  25 +expect "Initialized empty Git repository in $TEST_BASE_FULL/foo/u1/a01.git/"
26 26 # expect "R access for foo/u1/a01 DENIED to u1"
27 27
28 28 name "u2 create success"
29 29 runlocal git clone u2:foo/u2/a02
30   -expect "Initialized empty Git repository in /home/gitolite-test/repositories/foo/u2/a02.git/"
  30 +expect "Initialized empty Git repository in $TEST_BASE_FULL/foo/u2/a02.git/"
31 31 # expect "R access for foo/u2/a02 DENIED to u2"
32 32
33 33 name "u4 tries to create u2 repo"
@@ -40,7 +40,7 @@ expect "R access for foo/u4/a1234 DENIED to u4"
40 40
41 41 name "u4 tries to create his own repo"
42 42 runlocal git clone u4:foo/u4/a12
43   -expect "Initialized empty Git repository in /home/gitolite-test/repositories/foo/u4/a12.git/"
  43 +expect "Initialized empty Git repository in $TEST_BASE_FULL/foo/u4/a12.git/"
44 44 expect "warning: You appear to have cloned an empty repository."
45 45
46 46 name "u4 push success"
2  t/t04a-wild-students
@@ -38,7 +38,7 @@ expect "R access for foo/u4/a1234 DENIED to u4"
38 38
39 39 name "u4 tries to create his own repo"
40 40 runlocal git clone u4:foo/u4/a12
41   -expect "Initialized empty Git repository in /home/gitolite-test/repositories/foo/u4/a12.git/"
  41 +expect "Initialized empty Git repository in $TEST_BASE_FULL/foo/u4/a12.git/"
42 42 expect "warning: You appear to have cloned an empty repository."
43 43
44 44 name "u4 push success"
2  t/t05a-delegation
@@ -30,7 +30,7 @@ echo "
30 30 " > conf/fragments/u1r.conf
31 31 ugc < /dev/null
32 32 expect "create mode 100644 conf/fragments/u1r.conf"
33   -expect "remote: Initialized empty Git repository in /home/gitolite-test/repositories/r1a.git/"
  33 +expect "remote: Initialized empty Git repository in $TEST_BASE_FULL/r1a.git/"
34 34
35 35 expect "To gitolite:gitolite-admin"
36 36 expect "master -> master"
2  t/t50-sequence-test
@@ -21,7 +21,7 @@ do
21 21
22 22 cd ~/td
23 23 runlocal git clone u1:foo/u1/bar
24   - expect "Initialized empty Git repository in /home/gitolite-test/repositories/foo/u1/bar.git/"
  24 + expect "Initialized empty Git repository in $TEST_BASE_FULL/foo/u1/bar.git/"
25 25
26 26 cd bar
27 27 mdc u1file1
2  t/t53-check-info-expand-output
@@ -26,7 +26,7 @@ do
26 26 runlocal git clone u1:foo/u1/bar
27 27 [ "$wr" = "0" ] && expect "R access for foo/u1/bar DENIED to u1"
28 28 [ "$wr" = "0" ] && expect "fatal: The remote end hung up unexpectedly"
29   - [ "$wr" = "1" ] && expect "Initialized empty Git repository in /home/gitolite-test/repositories/foo/u1/bar.git/"
  29 + [ "$wr" = "1" ] && expect "Initialized empty Git repository in $TEST_BASE_FULL/foo/u1/bar.git/"
30 30
31 31 name "u3 fails to make a wildrepo"
32 32 runlocal git clone u3:foo/u3/baz
8 t/t54-repo-configs
@@ -45,10 +45,10 @@ do
45 45 RW = @devs
46 46 config foo.bar = baz
47 47 " | ugc -r
48   - expect "remote: Initialized empty Git repository in /home/gitolite-test/repositories/bar.git/"
  48 + expect "remote: Initialized empty Git repository in $TEST_BASE_FULL/bar.git/"
49 49 notexpect "git config.*not allowed"
50 50 expect_push_ok "master -> master"
51   - runremote cat repositories/bar.git/config
  51 + runremote cat $TEST_BASE/bar.git/config
52 52 expect '^.foo'
53 53 expect 'bar = baz'
54 54
@@ -65,7 +65,7 @@ do
65 65 config foobar.baz = ooka
66 66 " | ugc -r
67 67 expect "remote: git config foobar.baz not allowed"
68   - runremote cat repositories/bar.git/config
  68 + runremote cat $TEST_BASE/bar.git/config
69 69 expect '^.foo'
70 70 expect 'bar = baz'
71 71 notexpect '^.foobar'
@@ -82,7 +82,7 @@ do
82 82 RW = @devs
83 83 config foo.bar =
84 84 " | ugc -r
85   - runremote cat repositories/bar.git/config
  85 + runremote cat $TEST_BASE/bar.git/config
86 86 expect '^.foo'
87 87 notexpect 'bar = baz'
88 88
14 t/t55-repo-configs-wild-without-CREATOR
@@ -71,10 +71,10 @@ do
71 71
72 72 name "u1 create bar/try1"
73 73 runlocal git ls-remote u1:bar/try1
74   - expect "Initialized empty Git repository in /home/gitolite-test/repositories/bar/try1.git/"
  74 + expect "Initialized empty Git repository in $TEST_BASE_FULL/bar/try1.git/"
75 75
76 76 name "check u1 has foo.bar"
77   - runremote cat repositories/bar/try1.git/config
  77 + runremote cat $TEST_BASE/bar/try1.git/config
78 78 expect '^.foo'
79 79 expect 'bar = baz'
80 80
@@ -93,16 +93,16 @@ do
93 93 expect_push_ok "master -> master"
94 94
95 95 name "check u1 doesnt have foo.bar"
96   - runremote cat repositories/bar/try1.git/config
  96 + runremote cat $TEST_BASE/bar/try1.git/config
97 97 expect '^.foo' # git leaves the section header behind
98 98 notexpect 'bar = baz'
99 99
100 100 name "u2 create bar/try2"
101 101 runlocal git ls-remote u2:bar/try2
102   - expect "Initialized empty Git repository in /home/gitolite-test/repositories/bar/try2.git/"
  102 + expect "Initialized empty Git repository in $TEST_BASE_FULL/bar/try2.git/"
103 103
104 104 name "check u2 doesnt have foo.bar"
105   - runremote cat repositories/bar/try2.git/config
  105 + runremote cat $TEST_BASE/bar/try2.git/config
106 106 notexpect '^.foo' # but not here, since this repo never had the key at all
107 107 notexpect 'bar = baz'
108 108
@@ -121,12 +121,12 @@ do
121 121 expect_push_ok "master -> master"
122 122
123 123 name "check u1 has foo.frob"
124   - runremote cat repositories/bar/try1.git/config
  124 + runremote cat $TEST_BASE/bar/try1.git/config
125 125 expect '^.foo'
126 126 expect 'frob = nitz'
127 127
128 128 name "check u2 has foo.frob"
129   - runremote cat repositories/bar/try2.git/config
  129 + runremote cat $TEST_BASE/bar/try2.git/config
130 130 expect '^.foo'
131 131 expect 'frob = nitz'
132 132
14 t/t56-repo-configs-wild-with-CREATOR
@@ -65,10 +65,10 @@ do
65 65
66 66 name "u1 create bar/u1/try1"
67 67 runlocal git ls-remote u1:bar/u1/try1
68   - expect "Initialized empty Git repository in /home/gitolite-test/repositories/bar/u1/try1.git/"
  68 + expect "Initialized empty Git repository in $TEST_BASE_FULL/bar/u1/try1.git/"
69 69
70 70 name "check u1 has foo.bar"
71   - runremote cat repositories/bar/u1/try1.git/config
  71 + runremote cat $TEST_BASE/bar/u1/try1.git/config
72 72 expect '^.foo'
73 73 expect 'bar = baz'
74 74
@@ -86,16 +86,16 @@ do
86 86 expect_push_ok "master -> master"
87 87
88 88 name "check u1 doesnt have foo.bar"
89   - runremote cat repositories/bar/u1/try1.git/config
  89 + runremote cat $TEST_BASE/bar/u1/try1.git/config
90 90 expect '^.foo' # git leaves the section header behind
91 91 notexpect 'bar = baz'
92 92
93 93 name "u2 create bar/u2/try2"
94 94 runlocal git ls-remote u2:bar/u2/try2
95   - expect "Initialized empty Git repository in /home/gitolite-test/repositories/bar/u2/try2.git/"
  95 + expect "Initialized empty Git repository in $TEST_BASE_FULL/bar/u2/try2.git/"
96 96
97 97 name "check u2 doesnt have foo.bar"
98   - runremote cat repositories/bar/u2/try2.git/config
  98 + runremote cat $TEST_BASE/bar/u2/try2.git/config
99 99 notexpect '^.foo' # but not here, since this repo never had the key at all
100 100 notexpect 'bar = baz'
101 101
@@ -113,12 +113,12 @@ do
113 113 expect_push_ok "master -> master"
114 114
115 115 name "check u1 has foo.frob"
116   - runremote cat repositories/bar/u1/try1.git/config
  116 + runremote cat $TEST_BASE/bar/u1/try1.git/config
117 117 expect '^.foo'
118 118 expect 'frob = nitz'
119 119
120 120 name "check u2 has foo.frob"
121   - runremote cat repositories/bar/u2/try2.git/config
  121 + runremote cat $TEST_BASE/bar/u2/try2.git/config
122 122 expect '^.foo'
123 123 expect 'frob = nitz'
124 124
30 t/t57-daemon-gitweb
@@ -15,9 +15,9 @@ do
15 15 name "INTERNAL"
16 16 echo|ugc
17 17 name "daemon access for testing repo"
18   - runremote ls -al repositories/testing.git/git-daemon-export-ok
19   - [ "$ais" = "0" ] && expect "ls: cannot access repositories/testing.git/git-daemon-export-ok: No such file or directory"
20   - [ "$ais" = "1" ] && expect "gitolite-test gitolite-test .* repositories/testing.git/git-daemon-export-ok"
  18 + runremote ls -al $TEST_BASE/testing.git/git-daemon-export-ok
  19 + [ "$ais" = "0" ] && expect "ls: cannot access $TEST_BASE/testing.git/git-daemon-export-ok: No such file or directory"
  20 + [ "$ais" = "1" ] && expect "gitolite-test gitolite-test .* $TEST_BASE/testing.git/git-daemon-export-ok"
21 21
22 22 name "INTERNAL"
23 23 echo "
@@ -30,8 +30,8 @@ do
30 30 RW = @devs
31 31 " | ugc
32 32 expect_push_ok "master -> master"
33   - runremote ls -al repositories/bar.git/git-daemon-export-ok
34   - expect "ls: cannot access repositories/bar.git/git-daemon-export-ok: No such file or directory"
  33 + runremote ls -al $TEST_BASE/bar.git/git-daemon-export-ok
  34 + expect "ls: cannot access $TEST_BASE/bar.git/git-daemon-export-ok: No such file or directory"
35 35 runremote ls -al projects.list
36 36 [ "$ais" = "0" ] && expect "gitolite-test gitolite-test 0 .* projects.list"
37 37 [ "$ais" = "1" ] && expect "gitolite-test gitolite-test 12 .* projects.list"
@@ -43,8 +43,8 @@ do
43 43 echo "
44 44 R = daemon
45 45 " | ugc
46   - runremote ls -al repositories/bar.git/git-daemon-export-ok
47   - expect "gitolite-test gitolite-test .* repositories/bar.git/git-daemon-export-ok"
  46 + runremote ls -al $TEST_BASE/bar.git/git-daemon-export-ok
  47 + expect "gitolite-test gitolite-test .* $TEST_BASE/bar.git/git-daemon-export-ok"
48 48 runremote ls -al projects.list
49 49 [ "$ais" = "0" ] && expect "gitolite-test gitolite-test 0 .* projects.list"
50 50 [ "$ais" = "1" ] && expect "gitolite-test gitolite-test 12 .* projects.list"
@@ -93,7 +93,7 @@ do
93 93 baz = \"this is repo baz\"
94 94 " | ugc
95 95 expect_push_ok "master -> master"
96   - expect "remote: Initialized empty Git repository in /home/gitolite-test/repositories/baz.git/"
  96 + expect "remote: Initialized empty Git repository in $TEST_BASE_FULL/baz.git/"
97 97 runremote ls -al projects.list
98 98 [ "$ais" = "0" ] && expect "gitolite-test gitolite-test 24 .* projects.list"
99 99 [ "$ais" = "1" ] && expect "gitolite-test gitolite-test 36 .* projects.list"
@@ -103,9 +103,9 @@ do
103 103 expect "foo.git"
104 104 expect "bar.git"
105 105 expect "baz.git"
106   - runremote ls -al repositories/baz.git/description
107   - expect "gitolite-test gitolite-test 17 .* repositories/baz.git/description"
108   - runremote cat repositories/baz.git/description
  106 + runremote ls -al $TEST_BASE/baz.git/description
  107 + expect "gitolite-test gitolite-test 17 .* $TEST_BASE/baz.git/description"
  108 + runremote cat $TEST_BASE/baz.git/description
109 109 expect "this is repo baz"
110 110
111 111 name "add owner to testing repo"
@@ -120,12 +120,12 @@ do
120 120 expect "foo.git"
121 121 expect "bar.git"
122 122 expect "baz.git"
123   - runremote cat repositories/testing.git/config
  123 + runremote cat $TEST_BASE/testing.git/config
124 124 expect "\[gitweb\]"
125 125 expect "owner = sitaram"
126   - runremote ls -al repositories/testing.git/description
127   - expect "gitolite-test gitolite-test 25 .* repositories/testing.git/description"
128   - runremote cat repositories/testing.git/description
  126 + runremote ls -al $TEST_BASE/testing.git/description
  127 + expect "gitolite-test gitolite-test 25 .* $TEST_BASE/testing.git/description"
  128 + runremote cat $TEST_BASE/testing.git/description
129 129 expect "this is the testing repo"
130 130
131 131 name INTERNAL
34 t/t58-daemon-gitweb-wild
@@ -24,8 +24,8 @@ do
24 24 " | ugc
25 25 expect_push_ok "master -> master"
26 26 runlocal git ls-remote u1:bar/u1/try1
27   - runremote ls -al repositories/bar/u1/try1.git/git-daemon-export-ok
28   - expect "ls: cannot access repositories/bar/u1/try1.git/git-daemon-export-ok: No such file or directory"
  27 + runremote ls -al $TEST_BASE/bar/u1/try1.git/git-daemon-export-ok
  28 + expect "ls: cannot access $TEST_BASE/bar/u1/try1.git/git-daemon-export-ok: No such file or directory"
29 29 runremote ls -al projects.list
30 30 [ "$ais" = "0" ] && expect "gitolite-test gitolite-test 0 .* projects.list"
31 31 [ "$ais" = "1" ] && expect "gitolite-test gitolite-test 12 .* projects.list"
@@ -38,16 +38,16 @@ do
38 38 echo "
39 39 R = daemon
40 40 " | ugc
41   - runremote ls -al repositories/bar/u1/try1.git/git-daemon-export-ok
42   - expect "gitolite-test gitolite-test .* repositories/bar/u1/try1.git/git-daemon-export-ok"
  41 + runremote ls -al $TEST_BASE/bar/u1/try1.git/git-daemon-export-ok
  42 + expect "gitolite-test gitolite-test .* $TEST_BASE/bar/u1/try1.git/git-daemon-export-ok"
43 43 runremote ls -al projects.list
44 44 [ "$ais" = "0" ] && expect "gitolite-test gitolite-test 0 .* projects.list"
45 45 [ "$ais" = "1" ] && expect "gitolite-test gitolite-test 12 .* projects.list"
46 46
47 47 name "add one more repo"
48 48 runlocal git ls-remote u1:bar/u1/try2
49   - runremote ls -al repositories/bar/u1/try2.git/git-daemon-export-ok
50   - expect "gitolite-test gitolite-test .* repositories/bar/u1/try2.git/git-daemon-export-ok"
  49 + runremote ls -al $TEST_BASE/bar/u1/try2.git/git-daemon-export-ok
  50 + expect "gitolite-test gitolite-test .* $TEST_BASE/bar/u1/try2.git/git-daemon-export-ok"
51 51 runremote ls -al projects.list
52 52 [ "$ais" = "0" ] && expect "gitolite-test gitolite-test 0 .* projects.list"
53 53 [ "$ais" = "1" ] && expect "gitolite-test gitolite-test 12 .* projects.list"
@@ -71,13 +71,13 @@ do
71 71 expect "bar/u1/try1.git"
72 72 notexpect "bar/u1/try2.git"
73 73 notexpect "bar/u1/try3.git"
74   - runremote cat repositories/bar/u1/try1.git/description
  74 + runremote cat $TEST_BASE/bar/u1/try1.git/description
75 75 expect "this is bar/u1/try1"
76 76
77 77 name "add try3 project"
78 78 runlocal git ls-remote u1:bar/u1/try3
79   - runremote ls -al repositories/bar/u1/try3.git/git-daemon-export-ok
80   - expect "gitolite-test gitolite-test .* repositories/bar/u1/try3.git/git-daemon-export-ok"
  79 + runremote ls -al $TEST_BASE/bar/u1/try3.git/git-daemon-export-ok
  80 + expect "gitolite-test gitolite-test .* $TEST_BASE/bar/u1/try3.git/git-daemon-export-ok"
81 81 runremote ls -al projects.list
82 82 [ "$ais" = "0" ] && expect "gitolite-test gitolite-test 16 .* projects.list"
83 83 [ "$ais" = "1" ] && expect "gitolite-test gitolite-test 28 .* projects.list"
@@ -87,16 +87,16 @@ do
87 87 expect "bar/u1/try1.git"
88 88 notexpect "bar/u1/try2.git"
89 89 notexpect "bar/u1/try3.git"
90   - runremote cat repositories/bar/u1/try1.git/description
  90 + runremote cat $TEST_BASE/bar/u1/try1.git/description
91 91 expect "this is bar/u1/try1"
92   - runremote cat repositories/bar/u1/try3.git/description
  92 + runremote cat $TEST_BASE/bar/u1/try3.git/description
93 93 expect "Unnamed repository; edit this file 'description' to name the repository."
94 94
95 95 name "now compile and recheck try3 stuff"
96 96 echo "
97 97 " | ugc
98   - runremote ls -al repositories/bar/u1/try3.git/git-daemon-export-ok
99   - expect "gitolite-test gitolite-test .* repositories/bar/u1/try3.git/git-daemon-export-ok"
  98 + runremote ls -al $TEST_BASE/bar/u1/try3.git/git-daemon-export-ok
  99 + expect "gitolite-test gitolite-test .* $TEST_BASE/bar/u1/try3.git/git-daemon-export-ok"
100 100 runremote ls -al projects.list
101 101 [ "$ais" = "0" ] && expect "gitolite-test gitolite-test 32 .* projects.list"
102 102 [ "$ais" = "1" ] && expect "gitolite-test gitolite-test 44 .* projects.list"
@@ -106,16 +106,16 @@ do
106 106 expect "bar/u1/try1.git"
107 107 notexpect "bar/u1/try2.git"
108 108 expect "bar/u1/try3.git"
109   - runremote cat repositories/bar/u1/try1.git/description
  109 + runremote cat $TEST_BASE/bar/u1/try1.git/description
110 110 expect "this is bar/u1/try1"
111   - runremote cat repositories/bar/u1/try3.git/description
  111 + runremote cat $TEST_BASE/bar/u1/try3.git/description
112 112 expect "this is bar/u1/try3"
113 113
114 114 name "add owner for try2 and compile"
115 115 echo "
116 116 bar/u1/try2 \"owner2\" = \"this is bar/u1/try1\"
117 117 " | ugc
118   - runremote cat repositories/bar/u1/try2.git/config
  118 + runremote cat $TEST_BASE/bar/u1/try2.git/config
119 119 expect "\[gitweb\]"
120 120 expect "owner = owner2"
121 121 runremote ls -al projects.list
@@ -152,7 +152,7 @@ do
152 152 expect "bar/u1/try2.git"
153 153 expect "bar/u1/try3.git"
154 154 expect "bar/u1/try4.git"
155   - runremote cat repositories/bar/u1/try4.git/description
  155 + runremote cat $TEST_BASE/bar/u1/try4.git/description
156 156 expect "Unnamed repository; edit this file 'description' to name the repository."
157 157
158 158 name "INTERNAL"
10 t/t59-repo-not-on-disk
@@ -19,7 +19,7 @@ do
19 19 R = @g2
20 20 " | ugc
21 21 expect_push_ok "master -> master"
22   - expect "remote: Initialized empty Git repository in /home/gitolite-test/repositories/aa.git/"
  22 + expect "remote: Initialized empty Git repository in $TEST_BASE_FULL/aa.git/"
23 23
24 24 cd ~/td
25 25 name "check u1 can auto-create and push"
@@ -71,24 +71,24 @@ do
71 71 expect "R access for aa DENIED to u6"
72 72
73 73 # now the same thing with the repo-on-disk missing
74   - runremote rm -rf repositories/aa.git
  74 + runremote rm -rf $TEST_BASE/aa.git
75 75
76 76 cd ~/td
77 77 name "repo on disk missing: u1"
78 78 runlocal git clone u1:aa
79   - [ "$bc" = "0" ] && expect "fatal: 'repositories/aa.git' does not appear to be a git repository"
  79 + [ "$bc" = "0" ] && expect "fatal: '$TEST_BASE_FULL/aa.git' does not appear to be a git repository"
80 80 [ "$bc" = "1" ] && expect "R access for aa DENIED to u1"
81 81 [ "$bc" = "1" ] && expect "Or there may be no repository at the given path. Did you spell it correctly?"
82 82
83 83 name "repo on disk missing: tester"
84 84 runlocal git clone gitolite:aa
85   - [ "$bc" = "0" ] && expect "fatal: 'repositories/aa.git' does not appear to be a git repository"
  85 + [ "$bc" = "0" ] && expect "fatal: '$TEST_BASE_FULL/aa.git' does not appear to be a git repository"
86 86 [ "$bc" = "1" ] && expect "R access for aa DENIED to tester"
87 87 [ "$bc" = "1" ] && expect "Or there may be no repository at the given path. Did you spell it correctly?"
88 88
89 89 name "repo on disk missing: u4"
90 90 runlocal git clone u4:aa
91   - [ "$bc" = "0" ] && expect "fatal: 'repositories/aa.git' does not appear to be a git repository"
  91 + [ "$bc" = "0" ] && expect "fatal: '$TEST_BASE_FULL/aa.git' does not appear to be a git repository"
92 92 [ "$bc" = "1" ] && expect "R access for aa DENIED to u4"
93 93 [ "$bc" = "1" ] && expect "Or there may be no repository at the given path. Did you spell it correctly?"
94 94
50 t/t60-daemon-gitweb-via-setperms
@@ -25,8 +25,8 @@ do
25 25 expect_push_ok "master -> master"
26 26
27 27 runlocal git ls-remote u1:bar/u1/try1
28   - runremote ls -al repositories/bar/u1/try1.git/git-daemon-export-ok
29   - expect "ls: cannot access repositories/bar/u1/try1.git/git-daemon-export-ok: No such file or directory"
  28 + runremote ls -al $TEST_BASE/bar/u1/try1.git/git-daemon-export-ok
  29 + expect "ls: cannot access $TEST_BASE/bar/u1/try1.git/git-daemon-export-ok: No such file or directory"
30 30 runremote ls -al projects.list
31 31 [ "$ais" = "0" ] && expect "gitolite-test gitolite-test 0 .* projects.list"
32 32 [ "$ais" = "1" ] && expect "gitolite-test gitolite-test 12 .* projects.list"
@@ -34,8 +34,8 @@ do
34 34 notexpect "bar/u1/try1.git"
35 35
36 36 runlocal git ls-remote u1:bar/u1/try2
37   - runremote ls -al repositories/bar/u1/try2.git/git-daemon-export-ok
38   - expect "ls: cannot access repositories/bar/u1/try2.git/git-daemon-export-ok: No such file or directory"
  37 + runremote ls -al $TEST_BASE/bar/u1/try2.git/git-daemon-export-ok
  38 + expect "ls: cannot access $TEST_BASE/bar/u1/try2.git/git-daemon-export-ok: No such file or directory"
39 39 runremote ls -al projects.list
40 40 [ "$ais" = "0" ] && expect "gitolite-test gitolite-test 0 .* projects.list"
41 41 [ "$ais" = "1" ] && expect "gitolite-test gitolite-test 12 .* projects.list"
@@ -46,8 +46,8 @@ do
46 46 echo R daemon | runlocal ssh u1 setperms bar/u1/try1
47 47 expect "READERS daemon"
48 48
49   - runremote ls -al repositories/bar/u1/try1.git/git-daemon-export-ok
50   - expect "gitolite-test gitolite-test .* repositories/bar/u1/try1.git/git-daemon-export-ok"
  49 + runremote ls -al $TEST_BASE/bar/u1/try1.git/git-daemon-export-ok
  50 + expect "gitolite-test gitolite-test .* $TEST_BASE/bar/u1/try1.git/git-daemon-export-ok"
51 51 runremote ls -al projects.list
52 52 [ "$ais" = "0" ] && expect "gitolite-test gitolite-test 0 .* projects.list"
53 53 [ "$ais" = "1" ] && expect "gitolite-test gitolite-test 12 .* projects.list"
@@ -58,8 +58,8 @@ do
58 58 echo R gitweb | runlocal ssh u1 setperms bar/u1/try2
59 59 expect "READERS gitweb"
60 60
61   - runremote ls -al repositories/bar/u1/try2.git/git-daemon-export-ok
62   - expect "ls: cannot access repositories/bar/u1/try2.git/git-daemon-export-ok: No such file or directory"
  61 + runremote ls -al $TEST_BASE/bar/u1/try2.git/git-daemon-export-ok
  62 + expect "ls: cannot access $TEST_BASE/bar/u1/try2.git/git-daemon-export-ok: No such file or directory"
63 63 runremote ls -al projects.list
64 64 [ "$ais" = "0" ] && expect "gitolite-test gitolite-test 16 .* projects.list"
65 65 [ "$ais" = "1" ] && expect "gitolite-test gitolite-test 28 .* projects.list"
@@ -70,8 +70,8 @@ do
70 70
71 71 name "add default daemon access"
72 72 runlocal git ls-remote u1:bar/u1/try3
73   - runremote ls -al repositories/bar/u1/try3.git/git-daemon-export-ok
74   - expect "gitolite-test gitolite-test .* repositories/bar/u1/try3.git/git-daemon-export-ok"
  73 + runremote ls -al $TEST_BASE/bar/u1/try3.git/git-daemon-export-ok
  74 + expect "gitolite-test gitolite-test .* $TEST_BASE/bar/u1/try3.git/git-daemon-export-ok"
75 75 runremote ls -al projects.list
76 76 [ "$ais" = "0" ] && expect "gitolite-test gitolite-test 16 .* projects.list"
77 77 [ "$ais" = "1" ] && expect "gitolite-test gitolite-test 28 .* projects.list"
@@ -82,8 +82,8 @@ do
82 82 echo "\$GL_WILDREPOS_DEFPERMS = 'R gitweb';" | addrc
83 83
84 84 runlocal git ls-remote u1:bar/u1/try4
85   - runremote ls -al repositories/bar/u1/try4.git/git-daemon-export-ok
86   - expect "ls: cannot access repositories/bar/u1/try4.git/git-daemon-export-ok: No such file or directory"
  85 + runremote ls -al $TEST_BASE/bar/u1/try4.git/git-daemon-export-ok
  86 + expect "ls: cannot access $TEST_BASE/bar/u1/try4.git/git-daemon-export-ok: No such file or directory"
87 87 runremote ls -al projects.list
88 88 [ "$ais" = "0" ] && expect "gitolite-test gitolite-test 32 .* projects.list"
89 89 [ "$ais" = "1" ] && expect "gitolite-test gitolite-test 44 .* projects.list"
@@ -94,8 +94,8 @@ do
94 94 echo "\$GL_WILDREPOS_DEFPERMS = 'R daemon gitweb';" | addrc
95 95
96 96 runlocal git ls-remote u1:bar/u1/try5
97   - runremote ls -al repositories/bar/u1/try5.git/git-daemon-export-ok
98   - expect "gitolite-test gitolite-test .* repositories/bar/u1/try5.git/git-daemon-export-ok"
  97 + runremote ls -al $TEST_BASE/bar/u1/try5.git/git-daemon-export-ok
  98 + expect "gitolite-test gitolite-test .* $TEST_BASE/bar/u1/try5.git/git-daemon-export-ok"
99 99 runremote ls -al projects.list
100 100 [ "$ais" = "0" ] && expect "gitolite-test gitolite-test 48 .* projects.list"
101 101 [ "$ais" = "1" ] && expect "gitolite-test gitolite-test 60 .* projects.list"
@@ -106,8 +106,8 @@ do
106 106 echo "\$GL_WILDREPOS_DEFPERMS = 'R @all daemon gitweb';" | addrc
107 107
108 108 runlocal git ls-remote u1:bar/u1/try6
109   - runremote ls -al repositories/bar/u1/try6.git/git-daemon-export-ok
110   - expect "gitolite-test gitolite-test .* repositories/bar/u1/try6.git/git-daemon-export-ok"
  109 + runremote ls -al $TEST_BASE/bar/u1/try6.git/git-daemon-export-ok
  110 + expect "gitolite-test gitolite-test .* $TEST_BASE/bar/u1/try6.git/git-daemon-export-ok"
111 111 runremote ls -al projects.list
112 112 [ "$ais" = "0" ] && expect "gitolite-test gitolite-test 64 .* projects.list"
113 113 [ "$ais" = "1" ] && expect "gitolite-test gitolite-test 76 .* projects.list"
@@ -118,8 +118,8 @@ do
118 118 < /dev/null runlocal ssh u1 setperms bar/u1/try6
119 119
120 120 runlocal git ls-remote u1:bar/u1/try6
121   - runremote ls -al repositories/bar/u1/try6.git/git-daemon-export-ok
122   - expect "ls: cannot access repositories/bar/u1/try6.git/git-daemon-export-ok: No such file or directory"
  121 + runremote ls -al $TEST_BASE/bar/u1/try6.git/git-daemon-export-ok
  122 + expect "ls: cannot access $TEST_BASE/bar/u1/try6.git/git-daemon-export-ok: No such file or directory"
123 123 runremote ls -al projects.list
124 124 [ "$ais" = "0" ] && expect "gitolite-test gitolite-test 48 .* projects.list"
125 125 [ "$ais" = "1" ] && expect "gitolite-test gitolite-test 60 .* projects.list"
@@ -130,9 +130,9 @@ do
130 130 echo "\$GL_WILDREPOS_DEFPERMS = 'R @all';" | addrc
131 131
132 132 runlocal git ls-remote u1:bar/u1/try7
133   - runremote ls -al repositories/bar/u1/try7.git/git-daemon-export-ok
134   - [ "$ais" = "0" ] && expect "ls: cannot access repositories/bar/u1/try7.git/git-daemon-export-ok: No such file or directory"
135   - [ "$ais" = "1" ] && expect "gitolite-test gitolite-test .* repositories/bar/u1/try7.git/git-daemon-export-ok"
  133 + runremote ls -al $TEST_BASE/bar/u1/try7.git/git-daemon-export-ok
  134 + [ "$ais" = "0" ] && expect "ls: cannot access $TEST_BASE/bar/u1/try7.git/git-daemon-export-ok: No such file or directory"
  135 + [ "$ais" = "1" ] && expect "gitolite-test gitolite-test .* $TEST_BASE/bar/u1/try7.git/git-daemon-export-ok"
136 136 runremote ls -al projects.list
137 137 [ "$ais" = "0" ] && expect "gitolite-test gitolite-test 48 .* projects.list"
138 138 [ "$ais" = "1" ] && expect "gitolite-test gitolite-test 76 .* projects.list"
@@ -144,8 +144,8 @@ do
144 144 echo "\$GL_WILDREPOS_DEFPERMS = 'R daemon';" | addrc
145 145
146 146 runlocal git ls-remote u1:bar/u1/try8
147   - runremote ls -al repositories/bar/u1/try8.git/git-daemon-export-ok
148   - expect "gitolite-test gitolite-test .* repositories/bar/u1/try8.git/git-daemon-export-ok"
  147 + runremote ls -al $TEST_BASE/bar/u1/try8.git/git-daemon-export-ok
  148 + expect "gitolite-test gitolite-test .* $TEST_BASE/bar/u1/try8.git/git-daemon-export-ok"
149 149 runremote ls -al projects.list
150 150 [ "$ais" = "0" ] && expect "gitolite-test gitolite-test 48 .* projects.list"
151 151 [ "$ais" = "1" ] && expect "gitolite-test gitolite-test 76 .* projects.list"
@@ -156,8 +156,8 @@ do
156 156 echo "\$GL_WILDREPOS_DEFPERMS = 'R gitweb';" | addrc
157 157
158 158 runlocal git ls-remote u1:bar/u1/try9
159   - runremote ls -al repositories/bar/u1/try9.git/git-daemon-export-ok
160   - expect "ls: cannot access repositories/bar/u1/try9.git/git-daemon-export-ok: No such file or directory"
  159 + runremote ls -al $TEST_BASE/bar/u1/try9.git/git-daemon-export-ok
  160 + expect "ls: cannot access $TEST_BASE/bar/u1/try9.git/git-daemon-export-ok: No such file or directory"
161 161 runremote ls -al projects.list
162 162 [ "$ais" = "0" ] && expect "gitolite-test gitolite-test 64 .* projects.list"
163 163 [ "$ais" = "1" ] && expect "gitolite-test gitolite-test 92 .* projects.list"
2  t/t61-setperms-groups
@@ -23,7 +23,7 @@ do
23 23
24 24 name "u1 auto-creates a repo"
25 25 runlocal git ls-remote u1:bar/u1/try1
26   - expect "Initialized empty Git repository in /home/gitolite-test/repositories/bar/u1/try1.git/"
  26 + expect "Initialized empty Git repository in $TEST_BASE_FULL/bar/u1/try1.git/"
27 27 name "default permissions for u2 and u4"
28 28 runlocal ssh u1 expand
29 29 expect R.*W.*u1.*bar/u1/try1
4 t/t62-rule-sequences
@@ -25,7 +25,7 @@ do
25 25
26 26 cd ~/td
27 27 runlocal git clone u1:u1/r1
28   - expect "Initialized empty Git repository in /home/gitolite-test/repositories/u1/r1.git/"
  28 + expect "Initialized empty Git repository in $TEST_BASE_FULL/u1/r1.git/"
29 29 cd r1
30 30 mdc r1file1
31 31 runlocal git push origin master
@@ -52,7 +52,7 @@ do
52 52 cd ~/td
53 53 rm -rf r1
54 54 runlocal git clone u3:u3/r1
55   - expect "Initialized empty Git repository in /home/gitolite-test/repositories/u3/r1.git/"
  55 + expect "Initialized empty Git repository in $TEST_BASE_FULL/u3/r1.git/"
56 56 cd r1
57 57 mdc r1file1
58 58 runlocal git push origin master
2  t/t63-perm-cats
@@ -32,7 +32,7 @@ do
32 32 name "make foo/u1/u1r1"
33 33 rm -rf ~/td/u1r1
34 34 runlocal git clone u1:foo/u1/u1r1
35   - expect "Initialized empty Git repository in /home/gitolite-test/repositories/foo/u1/u1r1.git/"
  35 + expect "Initialized empty Git repository in $TEST_BASE_FULL/foo/u1/u1r1.git/"
36 36 cd ~/td/u1r1
37 37
38 38 name "CREATOR can push"
16 t/t64-write-able
@@ -43,7 +43,7 @@ do
43 43 name "u2 create and push bar/u2/r1"
44 44 cd ~/td
45 45 runlocal git clone u2:bar/u2/r1
46   - expect "Initialized empty Git repository in /home/gitolite-test/repositories/bar/u2/r1.git/"
  46 + expect "Initialized empty Git repository in $TEST_BASE_FULL/bar/u2/r1.git/"
47 47 expect "warning: You appear to have cloned an empty repository."
48 48 cd r1
49 49 mdc; mdc
@@ -107,9 +107,9 @@ do
107 107 echo foo down|runlocal ssh gitolite able dis foo
108 108 expect "disabling following locations with message:"
109 109 expect "foo down"
110   - expect "/home/gitolite-test/repositories/foo.git"
111   - runremote ls -al /home/gitolite-test/repositories/foo.git/.gitolite.down
112   - expect ".rw------- 1 gitolite-test gitolite-test .* ..:.. /home/gitolite-test/repositories/foo.git/.gitolite.down"
  110 + expect "$TEST_BASE/foo.git"
  111 + runremote ls -al $TEST_BASE/foo.git/.gitolite.down
  112 + expect ".rw------- 1 gitolite-test gitolite-test .* ..:.. $TEST_BASE/foo.git/.gitolite.down"
113 113
114 114 name "u1 push foo fail"
115 115 cd ~/td/foo
@@ -129,15 +129,15 @@ do
129 129 runlocal ssh u1 able en foo
130 130 expect "just .what. are you trying to pull, young man"
131 131 runlocal ssh gitolite able en foo
132   - expect "removed ./home/gitolite-test/repositories/foo.git/.gitolite.down."
  132 + expect "removed .$TEST_BASE_FULL/foo.git/.gitolite.down."
133 133 echo bar/u2/r1 down | runlocal ssh u1 able dis foo
134 134 expect "just .what. are you trying to pull, young man"
135 135 echo bar/u2/r1 down | runlocal ssh gitolite able dis bar/u2/r1
136 136 expect "disabling following locations with message:"
137 137 expect "bar/u2/r1 down"
138   - expect "/home/gitolite-test/repositories/bar/u2/r1.git"
139   - runremote ls -al /home/gitolite-test/repositories/bar/u2/r1.git/.gitolite.down
140   - expect ".rw------- 1 gitolite-test gitolite-test .. ... .. ..:.. /home/gitolite-test/repositories/bar/u2/r1.git/.gitolite.down"
  138 + expect "$TEST_BASE/bar/u2/r1.git"
  139 + runremote ls -al $TEST_BASE/bar/u2/r1.git/.gitolite.down
  140 + expect ".rw------- 1 gitolite-test gitolite-test .. ... .. ..:.. $TEST_BASE/bar/u2/r1.git/.gitolite.down"
141 141
142 142 name "u1 push foo"
143 143 cd ~/td/foo
8 t/t67-hub
@@ -56,9 +56,9 @@ do
56 56 name "setup: child is cloned and adds b1 and b2"
57 57 cd ~/td
58 58 runlocal ssh u2 fork r1 child/u2/myr1
59   - runremote ls -al repositories/child/u2/myr1.git/gl-forked-from
60   - expect "gitolite-test gitolite-test 3 .* repositories/child/u2/myr1.git/gl-forked-from"
61   - runremote cat repositories/child/u2/myr1.git/gl-forked-from
  59 + runremote ls -al $TEST_BASE/child/u2/myr1.git/gl-forked-from
  60 + expect "gitolite-test gitolite-test 3 .* $TEST_BASE/child/u2/myr1.git/gl-forked-from"
  61 + runremote cat $TEST_BASE/child/u2/myr1.git/gl-forked-from
62 62 expect r1
63 63 runlocal git clone u2:child/u2/myr1
64 64 cd myr1
@@ -136,7 +136,7 @@ do
136 136 echo | runlocal ssh u1 hub fetch r1 3
137 137 expect "user u2 asked you to"
138 138 expect "git fetch git://gl.example.com/child/u2/myr1 b3"
139   - expect "From /home/gitolite-test/repositories/child/u2/myr1"
  139 + expect "From $TEST_BASE_FULL/child/u2/myr1"
140 140 expect "\* \[new branch\] b3 -> requests/child/b3"
141 141
142 142 name "bob checks his pending requests"
14 t/test-driver.sh
... ... @@ -1,8 +1,14 @@
1 1 #!/bin/bash
2 2
3   -# see some sample tests for how to use these functions; there is not
  3 +# see some sample tests for how to use these functions; there is no
4 4 # documentation
5 5
  6 +# REPO_BASE has 2 manifestations in the output of various commands
  7 +export TEST_BASE=$(perl -e 'do "../conf/example.gitolite.rc"; print $REPO_BASE')
  8 +[ -z "$TEST_BASE" ] && { echo TEST_BASE not set >&2; exit 1; }
  9 +TEST_BASE_FULL=$TEST_BASE
  10 +[ "$TEST_BASE" = "repositories" ] && TEST_BASE_FULL=/home/gitolite-test/repositories
  11 +
6 12 testnum=0
7 13
8 14 # remote local command
@@ -10,14 +16,14 @@ runlocal() { "$@" > ~/1 2> ~/2; }
10 16 # remote run command
11 17 runremote() { ssh gitolite-test@localhost "$@" > ~/1 2> ~/2; }
12 18 # remote list repositories
13   -listrepos() { ssh gitolite-test@localhost find repositories -type d -name "*.git" | sort > ~/1 2> ~/2; }
  19 +listrepos() { ssh gitolite-test@localhost "cd $TEST_BASE; find . -type d -name '*.git'" | sort > ~/1 2> ~/2; }
14 20 # remote cat compiled pm
15 21 catconf() { ssh gitolite-test@localhost cat .gitolite/conf/gitolite.conf-compiled.pm > ~/1 2> ~/2; }
16 22 catconfs() {
17 23 (
18 24 ssh gitolite-test@localhost cat .gitolite/conf/gitolite.conf-compiled.pm
19   - ssh gitolite-test@localhost find repositories -name gl-conf \| sort
20   - ssh gitolite-test@localhost find repositories -name gl-conf \| sort \| xargs cat
  25 + ssh gitolite-test@localhost "cd $TEST_BASE; find . -name gl-conf | sort"
  26 + ssh gitolite-test@localhost "cd $TEST_BASE; find . -name gl-conf | sort | xargs cat"
21 27 ) > ~/1 2> ~/2
22 28 }
23 29 # remote cat ~/.gitolite.rc
1  t/update-gitolite
@@ -12,3 +12,4 @@ src/gl-easy-install -q gitolite-test localhost tester
12 12 cd
13 13 tar cf rollback.tar gitolite-admin
14 14 ssh gitolite-test@localhost tar cf rollback.tar .ssh .gitolite .gitolite.rc repositories gitolite-install
  15 +ssh gitolite-test@localhost tar -C /tmp -cf \$HOME/rollback2.tar glrb

0 comments on commit 6539009

Please sign in to comment.
Something went wrong with that request. Please try again.