fix accumulation of 'config' (git config) lines

If a repo matches multiple patterns, 'config' lines were being picked up
only from one of the 'repo' paras, instead of from all applicable ones.
This commit is contained in:
Sitaram Chamarty 2011-08-06 08:43:24 +05:30
parent 4c1e4b2b1a
commit 0b68365860
3 changed files with 48 additions and 3 deletions

View file

@ -30,7 +30,7 @@ do
name "update rc file to allow foo.*"
catrc
cp ~/1 ~/junk
perl -pi -e 's/GL_GITCONFIG_KEYS = ""/GL_GITCONFIG_KEYS = "foo\\\\..*"/' ~/junk
perl -pi -e 's/GL_GITCONFIG_KEYS = ""/GL_GITCONFIG_KEYS = "gl\\\\..* foo\\\\..*"/' ~/junk
cat ~/junk | runremote dd of=.gitolite.rc
catrc
expect "GL_GITCONFIG_KEYS.*foo"
@ -130,6 +130,41 @@ do
expect '^.foo'
expect 'frob = nitz'
name "check cumulative configs"
echo "
repo @all
config gl.mirror.master = \"git@gc.com git@gh.net\"
@leads = u1 u2
@devs = u1 u2 u3 u4
@gbar = bar/..*
repo @gbar
C = @leads
RW+ = CREATOR
RW = @leads
config foo.frob = nitz
repo b../tr.*
config foo.nitz = ham
" | ugc -r
expect_push_ok "master -> master"
name "check try1 has foo.frob"
runremote cat $TEST_BASE/bar/try1.git/config
expect '^.foo'
expect 'frob = nitz'
name "check try1 has foo.nitz"
runremote cat $TEST_BASE/bar/try2.git/config
expect '^.foo'
expect 'nitz = ham'
name "check @all config works..."
runremote cat $TEST_BASE/bar/try2.git/config
expect gl.\"mirror\"
expect master = .git.gc.com git.gh.net
name INTERNAL
done
done