summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: dd70235)
raw | patch | inline | side by side (parent: dd70235)
author | Martin Waitz <tali@admingilde.org> | |
Sat, 16 Sep 2006 21:09:02 +0000 (23:09 +0200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sun, 17 Sep 2006 08:58:56 +0000 (01:58 -0700) |
Perl spit out a varning when "blob" or "blob_plain" actions were
used without a $hash parameter.
Signed-off-by: Martin Waitz <tali@admingilde.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
used without a $hash parameter.
Signed-off-by: Martin Waitz <tali@admingilde.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
gitweb/gitweb.perl | patch | blob | history |
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 645ae795c753a64b08fdd92b1d6c1aab03cbae53..250138520fcc2c1116244379580c28bf9ba43bf3 100755 (executable)
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
}
sub git_blob_plain {
- # blobs defined by non-textual hash id's can be cached
my $expires;
- if ($hash =~ m/^[0-9a-fA-F]{40}$/) {
- $expires = "+1d";
- }
if (!defined $hash) {
if (defined $file_name) {
} else {
die_error(undef, "No file name defined");
}
+ } elsif ($hash =~ m/^[0-9a-fA-F]{40}$/) {
+ # blobs defined by non-textual hash id's can be cached
+ $expires = "+1d";
}
+
my $type = shift;
open my $fd, "-|", git_cmd(), "cat-file", "blob", $hash
or die_error(undef, "Couldn't cat $file_name, $hash");
}
sub git_blob {
- # blobs defined by non-textual hash id's can be cached
my $expires;
- if ($hash =~ m/^[0-9a-fA-F]{40}$/) {
- $expires = "+1d";
- }
if (!defined $hash) {
if (defined $file_name) {
} else {
die_error(undef, "No file name defined");
}
+ } elsif ($hash =~ m/^[0-9a-fA-F]{40}$/) {
+ # blobs defined by non-textual hash id's can be cached
+ $expires = "+1d";
}
+
my ($have_blame) = gitweb_check_feature('blame');
open my $fd, "-|", git_cmd(), "cat-file", "blob", $hash
or die_error(undef, "Couldn't cat $file_name, $hash");