Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 251343 | Differences between
and this patch

Collapse All | Expand All

(-)a/gitweb/gitweb.perl (-37 / +2 lines)
Lines 4809-4851 sub git_blobdiff { Link Here
4809
			or die_error(undef, "Open git-diff-tree failed");
4809
			or die_error(undef, "Open git-diff-tree failed");
4810
	}
4810
	}
4811
4811
4812
	# old/legacy style URI
4812
	# old/legacy style URI -- not generated anymore since 1.4.3.
4813
	if (!%diffinfo && # if new style URI failed
4813
	if (!%diffinfo) {
4814
	    defined $hash && defined $hash_parent) {
4815
		# fake git-diff-tree raw output
4816
		$diffinfo{'from_mode'} = $diffinfo{'to_mode'} = "blob";
4817
		$diffinfo{'from_id'} = $hash_parent;
4818
		$diffinfo{'to_id'}   = $hash;
4819
		if (defined $file_name) {
4820
			if (defined $file_parent) {
4821
				$diffinfo{'status'} = '2';
4822
				$diffinfo{'from_file'} = $file_parent;
4823
				$diffinfo{'to_file'}   = $file_name;
4824
			} else { # assume not renamed
4825
				$diffinfo{'status'} = '1';
4826
				$diffinfo{'from_file'} = $file_name;
4827
				$diffinfo{'to_file'}   = $file_name;
4828
			}
4829
		} else { # no filename given
4830
			$diffinfo{'status'} = '2';
4831
			$diffinfo{'from_file'} = $hash_parent;
4832
			$diffinfo{'to_file'}   = $hash;
4833
		}
4834
4835
		# non-textual hash id's can be cached
4836
		if ($hash =~ m/^[0-9a-fA-F]{40}$/ &&
4837
		    $hash_parent =~ m/^[0-9a-fA-F]{40}$/) {
4838
			$expires = '+1d';
4839
		}
4840
4841
		# open patch output
4842
		open $fd, "-|", git_cmd(), "diff", @diff_opts,
4843
			'-p', ($format eq 'html' ? "--full-index" : ()),
4844
			$hash_parent, $hash, "--"
4845
			or die_error(undef, "Open git-diff failed");
4846
	} else  {
4847
		die_error('404 Not Found', "Missing one of the blob diff parameters")
4814
		die_error('404 Not Found', "Missing one of the blob diff parameters")
4848
			unless %diffinfo;
4849
	}
4815
	}
4850
4816
4851
	# header
4817
	# header
4852
- 

Return to bug 251343