Merge branch 'gp/gitweb'
authorJunio C Hamano <gitster@pobox.com>
Wed, 9 Apr 2008 07:44:48 +0000 (00:44 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 9 Apr 2008 07:44:48 +0000 (00:44 -0700)
* gp/gitweb:
gitweb: fallback to system-wide config file (fixup)
gitweb: fallback to system-wide config file if default config does not exist

1  2 
gitweb/gitweb.perl
diff --combined gitweb/gitweb.perl
index 73d098a433f4238c43603ab03c838c1356e7ab7a,f73cfca5397bee913776054fcb2693d17bc3e9d8..e69d7fd07b74d2e1c06f26e98eb72c83183c19f8
@@@ -369,7 -369,12 +369,12 @@@ sub filter_snapshot_fmts 
  }
  
  our $GITWEB_CONFIG = $ENV{'GITWEB_CONFIG'} || "++GITWEB_CONFIG++";
- do $GITWEB_CONFIG if -e $GITWEB_CONFIG;
+ if (-e $GITWEB_CONFIG) {
+       do $GITWEB_CONFIG;
+ } else {
+       our $GITWEB_CONFIG_SYSTEM = $ENV{'GITWEB_CONFIG_SYSTEM'} || "++GITWEB_CONFIG_SYSTEM++";
+       do $GITWEB_CONFIG_SYSTEM if -e $GITWEB_CONFIG_SYSTEM;
+ }
  
  # version of the core git binary
  our $git_version = qx($GIT --version) =~ m/git version (.*)$/ ? $1 : "unknown";
@@@ -2164,7 -2169,7 +2169,7 @@@ sub parse_difftree_raw_line 
                $res{'to_mode'} = $2;
                $res{'from_id'} = $3;
                $res{'to_id'} = $4;
 -              $res{'status'} = $res{'status_str'} = $5;
 +              $res{'status'} = $5;
                $res{'similarity'} = $6;
                if ($res{'status'} eq 'R' || $res{'status'} eq 'C') { # renamed or copied
                        ($res{'from_file'}, $res{'to_file'}) = map { unquote($_) } split("\t", $7);
                $res{'to_mode'} = pop @{$res{'from_mode'}};
                $res{'from_id'} = [ split(' ', $3) ];
                $res{'to_id'} = pop @{$res{'from_id'}};
 -              $res{'status_str'} = $4;
                $res{'status'} = [ split('', $4) ];
                $res{'to_file'} = unquote($5);
        }
@@@ -3001,7 -3007,7 +3006,7 @@@ sub fill_from_file_info 
  sub is_deleted {
        my $diffinfo = shift;
  
 -      return $diffinfo->{'status_str'} =~ /D/;
 +      return $diffinfo->{'to_id'} eq ('0' x 40);
  }
  
  # does patch correspond to [previous] difftree raw line