diff options
author | Jakub Narebski <jnareb@gmail.com> | 2008-06-03 16:47:10 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-06-04 15:05:01 -0700 |
commit | 7f718e8b46b37a9e1caf58a372938817f04885d9 (patch) | |
tree | 4c0461af9b0af0efe78126e958b6621da63a9507 /builtin-name-rev.c | |
parent | dd613e6b8706f31c01aae622345dbaab3f276262 (diff) | |
download | git-7f718e8b46b37a9e1caf58a372938817f04885d9.tar.gz |
gitweb: Add charset info to "raw" output of 'text/plain' blobs
Earlier "blob_plain" view sent "charset=utf-8" only when gitweb
guessed the content type to be text by reading from it, and not when
the MIME type was obtained from /etc/mime.types, or when gitweb
couldn't guess mimetype and used $default_blob_plain_mimetype.
This fixes the bug by always add charset info from
$default_text_plain_charset (if it is defined) to "raw" (a=blob_plain)
output for 'text/plain' blobs.
Generating information for Content-Type: header got separated into
blob_contenttype() subroutine; adding charset info in a special case
was removed from blob_mimetype(), which now should return mimetype
only.
While at it cleanup code a bit: put subroutine parameter
initialization first, make error message more robust (when $file_name
is not defined) if more cryptic, remove unnecessary '"' around
variable ("$var" -> $var).
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-name-rev.c')
0 files changed, 0 insertions, 0 deletions