aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Narebski <jnareb@gmail.com>2006-08-27 23:45:26 +0200
committerJunio C Hamano <junkio@cox.net>2006-08-27 15:19:28 -0700
commit0aea33762b1262d11fb43eda9f3fc152b5622cca (patch)
tree9a0594a0a550c9c2a8c9168a7b2942f18e0d5c77
parent023782bd4df765b0555b8abc1830d9a90cdccca2 (diff)
downloadgit-0aea33762b1262d11fb43eda9f3fc152b5622cca.tar.gz
git-0aea33762b1262d11fb43eda9f3fc152b5622cca.tar.xz
gitweb: Remove git_to_hash function
Remove git_to_hash function, which was to translate symbolic reference to hash, and it's use in git_blobdiff. We don't try so hard to guess filename if it was not provided. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
-rwxr-xr-xgitweb/gitweb.perl23
1 files changed, 3 insertions, 20 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 9aa7e4df4..8d28207b1 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -625,26 +625,6 @@ sub git_get_hash_by_path {
return $3;
}
-# converts symbolic name to hash
-sub git_to_hash {
- my @params = @_;
- return undef unless @params;
-
- open my $fd, "-|", $GIT, "rev-parse", @params
- or return undef;
- my @hashes = map { chomp; $_ } <$fd>;
- close $fd;
-
- if (wantarray) {
- return @hashes;
- } elsif (scalar(@hashes) == 1) {
- # single hash
- return $hashes[0];
- } else {
- return \@hashes;
- }
-}
-
## ......................................................................
## git utility functions, directly accessing git repository
@@ -2733,6 +2713,9 @@ sub git_blobdiff {
if ($hash !~ /[0-9a-fA-F]{40}/) {
$hash = git_to_hash($hash);
}
+ } elsif (defined $hash &&
+ $hash =~ /[0-9a-fA-F]{40}/) {
+ # try to find filename from $hash
# read filtered raw output
open $fd, "-|", $GIT, "diff-tree", '-r', '-M', '-C', $hash_parent_base, $hash_base