Code

Merge branch 'gb/gitweb-snapshot-pathinfo'
[git.git] / contrib / hooks / update-paranoid
index 6e0d97c89facd69db8b01ebdaf09f3cca5e1a28e..d18b317b2f018d1d1a5a9677a7bdaf8956d65186 100644 (file)
@@ -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 = '';
@@ -258,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)$,;