From b916a07d281c463db5554f8238e2ad3858b1744c Mon Sep 17 00:00:00 2001 From: Sitaram Chamarty Date: Fri, 28 Aug 2009 20:41:21 +0530 Subject: [PATCH] update hook: using non-std branches revealed an unnecessary check for refs/heads/; removed --- doc/0-INSTALL.mkd | 8 ++------ src/update-hook.pl | 6 +++--- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/doc/0-INSTALL.mkd b/doc/0-INSTALL.mkd index 970237e..10450a2 100644 --- a/doc/0-INSTALL.mkd +++ b/doc/0-INSTALL.mkd @@ -10,12 +10,8 @@ If you managed to install git, you might already have what gitolite needs: * one user account on the server, with password access [2] A major objective is to allow use by people without root access, permissions -to create other userids, etc. If you have root, congratulations and all that, -but go add a user just for gitolite and do all this from that user. Really. -I see no earthly reason for this to run as root. - -And don't bug me about wanting to install it in `/opt` or whatever if you -haven't the time to read the docs or change a path in a config file. +to create other userids, etc. Even if you have root, please add a user just +for gitolite and do all this from that user. ### quick install diff --git a/src/update-hook.pl b/src/update-hook.pl index b4c4580..834a32f 100755 --- a/src/update-hook.pl +++ b/src/update-hook.pl @@ -60,9 +60,9 @@ chomp($merge_base = `git merge-base $oldsha $newsha`) my $perm = 'W'; # rewriting a tag is considered a rewind, in terms of permissions $perm = '+' if $ref =~ m(refs/tags/) and $oldsha ne ('0' x 40); -# non-ff push to branch. Notice that branch delete looks like a rewind, as it -# should -$perm = '+' if $ref =~ m(refs/heads/) and $oldsha ne $merge_base; +# non-ff push to ref +# notice that ref delete looks like a rewind, as it should +$perm = '+' if $oldsha ne $merge_base; my @allowed_refs; push @allowed_refs, @ { $repos{$ENV{GL_REPO}}{$perm}{$ENV{GL_USER}} || [] };