{"thread":{"id":"5580","subject":"[PATCH] gitweb: fix uninitialized variable warning.","startedAt":"2006-09-16T21:09:02Z","lastAt":"2006-09-17T09:00:16Z","messageCount":2,"participants":["Martin Waitz","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"27018","messageId":"20060916210902.GW17042@admingilde.org","threadId":"5580","inReplyTo":null,"subject":"[PATCH] gitweb: fix uninitialized variable warning.","fromName":"Martin Waitz","fromEmail":"tali@admingilde.org","sentAt":"2006-09-16T21:09:02Z","receivedAt":"2006-09-16T21:09:02Z","isPatch":true,"sender":{"key":"tali@admingilde.org","avatar":"https://gravatar.com/avatar/3f89b03eee362187effabe257898735b475673a12265c398ea9161259ae91553?d=mp&s=160"},"body":"Perl spit out a varning when \"blob\" or \"blob_plain\" actions were\nused without a $hash parameter.\n\nSigned-off-by: Martin Waitz <tali@admingilde.org>\n---\n gitweb/gitweb.perl |   16 ++++++++--------\n 1 files changed, 8 insertions(+), 8 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 2789657..ee561c6 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -2380,11 +2380,7 @@ sub git_heads {\n }\n \n sub git_blob_plain {\n-\t# blobs defined by non-textual hash id's can be cached\n \tmy $expires;\n-\tif ($hash =~ m/^[0-9a-fA-F]{40}$/) {\n-\t\t$expires = \"+1d\";\n-\t}\n \n \tif (!defined $hash) {\n \t\tif (defined $file_name) {\n@@ -2394,7 +2390,11 @@ sub git_blob_plain {\n \t\t} else {\n \t\t\tdie_error(undef, \"No file name defined\");\n \t\t}\n+\t} elsif ($hash =~ m/^[0-9a-fA-F]{40}$/) {\n+\t\t# blobs defined by non-textual hash id's can be cached\n+\t\t$expires = \"+1d\";\n \t}\n+\n \tmy $type = shift;\n \topen my $fd, \"-|\", git_cmd(), \"cat-file\", \"blob\", $hash\n \t\tor die_error(undef, \"Couldn't cat $file_name, $hash\");\n@@ -2422,11 +2422,7 @@ sub git_blob_plain {\n }\n \n sub git_blob {\n-\t# blobs defined by non-textual hash id's can be cached\n \tmy $expires;\n-\tif ($hash =~ m/^[0-9a-fA-F]{40}$/) {\n-\t\t$expires = \"+1d\";\n-\t}\n \n \tif (!defined $hash) {\n \t\tif (defined $file_name) {\n@@ -2436,7 +2432,11 @@ sub git_blob {\n \t\t} else {\n \t\t\tdie_error(undef, \"No file name defined\");\n \t\t}\n+\t} elsif ($hash =~ m/^[0-9a-fA-F]{40}$/) {\n+\t\t# blobs defined by non-textual hash id's can be cached\n+\t\t$expires = \"+1d\";\n \t}\n+\n \tmy $have_blame = gitweb_check_feature('blame');\n \topen my $fd, \"-|\", git_cmd(), \"cat-file\", \"blob\", $hash\n \t\tor die_error(undef, \"Couldn't cat $file_name, $hash\");\n-- \n1.4.2.gb8b6b\n\n-- \nMartin Waitz\n"},{"id":"27054","messageId":"7vzmcy6f6n.fsf@assigned-by-dhcp.cox.net","threadId":"5580","inReplyTo":"20060916210902.GW17042@admingilde.org","subject":"Re: [PATCH] gitweb: fix uninitialized variable warning.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-09-17T09:00:16Z","receivedAt":"2006-09-17T09:00:16Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Martin Waitz <tali@admingilde.org> writes:\n\n> @@ -2436,7 +2432,11 @@ sub git_blob {\n>  \t\t} else {\n>  \t\t\tdie_error(undef, \"No file name defined\");\n>  \t\t}\n> +\t} elsif ($hash =~ m/^[0-9a-fA-F]{40}$/) {\n> +\t\t# blobs defined by non-textual hash id's can be cached\n> +\t\t$expires = \"+1d\";\n>  \t}\n> +\n>  \tmy $have_blame = gitweb_check_feature('blame');\n>  \topen my $fd, \"-|\", git_cmd(), \"cat-file\", \"blob\", $hash\n>  \t\tor die_error(undef, \"Couldn't cat $file_name, $hash\");\n\nWill apply, but you seem to be out of sync.\n"}]}