@matheusbsbs / matheus-bagliano / commits / fa620f1ac8
Fork 0

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. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Shawn O. Pearce committed May 25, 2008 at 22:18 UTC fa620f1ac8191fa72e54b8b6acc3e424ecfae26e
1 file changed +1
contrib/hooks/update-paranoid
+1
@@ -259,6 +259,7 @@ deny "Refusing funny ref $ref" unless $ref =~ s,^refs/,,;
259 deny "Bad old value $old" unless $old =~ /^[a-z0-9]{40}$/;
260 deny "Bad new value $new" unless $new =~ /^[a-z0-9]{40}$/;
261 deny "Cannot determine who you are." unless $this_user;
262 +grant "No change requested." if $old eq $new;
263
264 $repository_name = File::Spec->rel2abs($git_dir);
265 $repository_name =~ m,/([^/]+)(?:\.git|/\.git)$,;