Skip to content

Commit

Permalink
redis caching: 'set-default-roles' fix...
Browse files Browse the repository at this point in the history
flush repo from cache
  • Loading branch information
sitaramc committed May 20, 2014
1 parent 4a0728e commit 949c45c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/triggers/set-default-roles
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@ die() { echo "$@" >&2; exit 1; }
cd $GL_REPO_BASE/$2.git || die "could not cd to $GL_REPO_BASE/$2.git"
gitolite git-config -r $2 gitolite-options.default.roles | sort | cut -f3 |
perl -pe 's/(\s)CREATOR(\s|$)/$1$ENV{GL_USER}$2/' > gl-perms

# cache control, if rc says caching is on
gitolite query-rc -q CACHE && perl -I$GL_LIBDIR -MGitolite::Cache -e "cache_control('flush', '$2')";

exit 0
12 changes: 11 additions & 1 deletion t/perm-default-roles.t
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use Gitolite::Test;
# permissions using role names
# ----------------------------------------------------------------------

try "plan 27";
try "plan 33";
try "DEF POK = !/DENIED/; !/failed to push/";

my $rb = `gitolite query-rc -n GL_REPO_BASE`;
Expand Down Expand Up @@ -107,10 +107,20 @@ try "
cd ..
gitolite access foo/u1/u1r3 u4 W
!ok
!/refs/../
/W any foo/u1/u1r3 u4 DENIED by fallthru/
# make foo/u1/u1r3
glt clone u1 file:///foo/u1/u1r3
/Initialized empty Git repository in .*/foo/u1/u1r3.git//
gitolite access foo/u1/u1r3 u4 W
ok
/refs/../
!/W any foo/u1/u1r3 u4 DENIED by fallthru/
# make bar/u3/u3r3
glt clone u3 file:///bar/u3/u3r3
/Initialized empty Git repository in .*/bar/u3/u3r3.git//
Expand Down

0 comments on commit 949c45c

Please sign in to comment.