Skip to contentSkip to conversation

Ignore no-op changes 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 3/3 Ignore no-op changes in paranoid update hook

If the hook gets invoked with identical old and new ids there is no change taking place. We probably should not have been called, but instead of failing silently allow the no-op.

---
 contrib/hooks/update-paranoid |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
contrib/hooks/update-paranoid +1 -0
index ae94822..d18b317 100644
@@ -259,6 +259,7 @@ deny "Refusing funny ref $ref" unless $ref =~ s,^refs/,,;
 deny "Bad old value $old" unless $old =~ /^[a-z0-9]{40}$/;
 deny "Bad new value $new" unless $new =~ /^[a-z0-9]{40}$/;
 deny "Cannot determine who you are." unless $this_user;
+grant "No change requested." if $old eq $new;
 
 $repository_name = File::Spec->rel2abs($git_dir);
 $repository_name =~ m,/([^/]+)(?:\.git|/\.git)$,;
Signature · 1 line
1.5.5.1.501.gefb4