summaryrefslogtreecommitdiff
path: root/gitweb
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2008-10-03 01:16:22 (GMT)
committerShawn O. Pearce <spearce@spearce.org>2008-10-03 01:16:22 (GMT)
commitbf8f2ad5f20b8c911d6a84438faa3c994decf71b (patch)
tree4e3e9d4bd39e1941a1c5905c479dd0ef79e4638e /gitweb
parent9126f0091f271f090cc030a788219574ab0fea97 (diff)
parent9a1fd653b13b6cc136bfa5b9563f629b2af1a6c8 (diff)
downloadgit-bf8f2ad5f20b8c911d6a84438faa3c994decf71b.zip
git-bf8f2ad5f20b8c911d6a84438faa3c994decf71b.tar.gz
git-bf8f2ad5f20b8c911d6a84438faa3c994decf71b.tar.bz2
Merge branch 'maint'
* maint: gitweb: Add path_info tests to t/t9500-gitweb-standalone-no-errors.sh gitweb: Fix two 'uninitialized value' warnings in git_tree() Solaris: Use OLD_ICONV to avoid compile warnings gitweb: remove PATH_INFO from $my_url and $my_uri
Diffstat (limited to 'gitweb')
-rwxr-xr-xgitweb/gitweb.perl10
1 files changed, 9 insertions, 1 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index c2732b3..83f810a 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -27,6 +27,13 @@ our $version = "++GIT_VERSION++";
our $my_url = $cgi->url();
our $my_uri = $cgi->url(-absolute => 1);
+# if we're called with PATH_INFO, we have to strip that
+# from the URL to find our real URL
+if (my $path_info = $ENV{"PATH_INFO"}) {
+ $my_url =~ s,\Q$path_info\E$,,;
+ $my_uri =~ s,\Q$path_info\E$,,;
+}
+
# core git executable to use
# this can just be "git" if your webserver has a sensible PATH
our $GIT = "++GIT_BINDIR++/git";
@@ -4445,6 +4452,7 @@ sub git_tree {
$hash = $hash_base;
}
}
+ die_error(404, "No such tree") unless defined($hash);
$/ = "\0";
open my $fd, "-|", git_cmd(), "ls-tree", '-z', $hash
or die_error(500, "Open git-ls-tree failed");
@@ -4485,8 +4493,8 @@ sub git_tree {
if ($basedir ne '' && substr($basedir, -1) ne '/') {
$basedir .= '/';
}
+ git_print_page_path($file_name, 'tree', $hash_base);
}
- git_print_page_path($file_name, 'tree', $hash_base);
print "<div class=\"page_body\">\n";
print "<table class=\"tree\">\n";
my $alternate = 1;