]> Lady’s Gitweb - Gitweb/blobdiff - gitweb.perl
gitweb: Default to $hash_base or HEAD for $hash in "commit" and "commitdiff"
[Gitweb] / gitweb.perl
index 64c7d54a506b6881152b7f4adc73c0f53cfe416f4536593a61679433224765bf..6503bd04508a2ef480abe004f97e234f3b119efcb138345ade5867711f6add0b 100755 (executable)
@@ -3430,6 +3430,7 @@ sub git_log {
 }
 
 sub git_commit {
 }
 
 sub git_commit {
+       $hash ||= $hash_base || "HEAD";
        my %co = parse_commit($hash);
        if (!%co) {
                die_error(undef, "Unknown commit object");
        my %co = parse_commit($hash);
        if (!%co) {
                die_error(undef, "Unknown commit object");
@@ -3707,6 +3708,7 @@ sub git_blobdiff_plain {
 
 sub git_commitdiff {
        my $format = shift || 'html';
 
 sub git_commitdiff {
        my $format = shift || 'html';
+       $hash ||= $hash_base || "HEAD";
        my %co = parse_commit($hash);
        if (!%co) {
                die_error(undef, "Unknown commit object");
        my %co = parse_commit($hash);
        if (!%co) {
                die_error(undef, "Unknown commit object");
This page took 0.259115 seconds and 4 git commands to generate.