aboutsummaryrefslogtreecommitdiff
path: root/gitweb
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-04-18 22:58:32 -0700
committerJunio C Hamano <gitster@pobox.com>2008-04-18 22:58:32 -0700
commitd9f39d9838f089c145817c6c0f25ffedcb1c500e (patch)
tree1489fcf3173ed657df1340b1c9a0063ce8da3daa /gitweb
parent9a49e00b9a239c58e074bab6e147b293809a3c6f (diff)
parent5634cf24766f8700804ca55f5e8567c88538a5b0 (diff)
downloadgit-d9f39d9838f089c145817c6c0f25ffedcb1c500e.tar.gz
git-d9f39d9838f089c145817c6c0f25ffedcb1c500e.tar.xz
Merge branch 'maint'
* maint: gitweb: Fix 'history' view for deleted files with history Document that WebDAV doesn't need git on the server, and works over SSL git-remote: reject adding remotes with invalid names am: POSIX portability fix
Diffstat (limited to 'gitweb')
-rwxr-xr-xgitweb/gitweb.perl18
1 files changed, 15 insertions, 3 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index e69d7fd07..a48bebb1b 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -5176,14 +5176,26 @@ sub git_history {
my $refs = git_get_references();
my $limit = sprintf("--max-count=%i", (100 * ($page+1)));
+ my @commitlist = parse_commits($hash_base, 101, (100 * $page),
+ $file_name, "--full-history");
+ if (!@commitlist) {
+ die_error('404 Not Found', "No such file or directory on given branch");
+ }
+
if (!defined $hash && defined $file_name) {
- $hash = git_get_hash_by_path($hash_base, $file_name);
+ # some commits could have deleted file in question,
+ # and not have it in tree, but one of them has to have it
+ for (my $i = 0; $i <= @commitlist; $i++) {
+ $hash = git_get_hash_by_path($commitlist[$i]{'id'}, $file_name);
+ last if defined $hash;
+ }
}
if (defined $hash) {
$ftype = git_get_type($hash);
}
-
- my @commitlist = parse_commits($hash_base, 101, (100 * $page), $file_name, "--full-history");
+ if (!defined $ftype) {
+ die_error(undef, "Unknown type of object");
+ }
my $paging_nav = '';
if ($page > 0) {