Skip to contentSkip to conversation

Don't load missing ACL files in paranoid update hook

PATCH In review Shawn O. Pearce 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 2/3 Don't load missing ACL files in paranoid update hook

If a user or group ACL file does not exist in the current tip revision of the acl repository we will get an error from cat-file when we ask for that blob as it cannot be resolved. A quick look at the history by rev-list can tell us if there is a path there or not.

---
 contrib/hooks/update-paranoid |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
contrib/hooks/update-paranoid +1 -0
index 6e0d97c..ae94822 100644
@@ -136,6 +136,7 @@ sub parse_config ($$$$) {
 	local $ENV{GIT_DIR} = shift;
 	my $br = shift;
 	my $fn = shift;
+	return unless git_value('rev-list','--max-count=1',$br,'--',$fn);
 	info "Loading $br:$fn";
 	open(I,'-|','git','cat-file','blob',"$br:$fn");
 	my $section = '';
Signature · 1 line
1.5.5.1.501.gefb4