Merge branch 'bs/lock'
[gitweb.git] / gitweb / gitweb.perl
index 1aceedec8e0a233a35f5cd74412f0fce82adf5d9..498b936dd48bef9a788b56c2ddbbacb63d1e29b6 100755 (executable)
@@ -436,12 +436,11 @@ sub filter_snapshot_fmts {
 
 our @extra_options = $cgi->param('opt');
 if (defined @extra_options) {
-       foreach(@extra_options)
-       {
-               if (not grep(/^$_$/, keys %allowed_options)) {
+       foreach my $opt (@extra_options) {
+               if (not exists $allowed_options{$opt}) {
                        die_error(undef, "Invalid option parameter");
                }
-               if (not grep(/^$action$/, @{$allowed_options{$_}})) {
+               if (not grep(/^$action$/, @{$allowed_options{$opt}})) {
                        die_error(undef, "Invalid option parameter for this action");
                }
        }
@@ -598,7 +597,6 @@ (%)
                action => "a",
                file_name => "f",
                file_parent => "fp",
-               extra_options => "opt",
                hash => "h",
                hash_parent => "hp",
                hash_base => "hb",
@@ -608,6 +606,7 @@ (%)
                searchtext => "s",
                searchtype => "st",
                snapshot_format => "sf",
+               extra_options => "opt",
        );
        my %mapping = @mapping;
 
@@ -630,7 +629,13 @@ (%)
        for (my $i = 0; $i < @mapping; $i += 2) {
                my ($name, $symbol) = ($mapping[$i], $mapping[$i+1]);
                if (defined $params{$name}) {
-                       push @result, $symbol . "=" . esc_param($params{$name});
+                       if (ref($params{$name}) eq "ARRAY") {
+                               foreach my $par (@{$params{$name}}) {
+                                       push @result, $symbol . "=" . esc_param($par);
+                               }
+                       } else {
+                               push @result, $symbol . "=" . esc_param($params{$name});
+                       }
                }
        }
        $href .= "?" . join(';', @result) if scalar @result;
@@ -2285,9 +2290,17 @@ sub git_header_html {
                printf('<link rel="alternate" title="%s log RSS feed" '.
                       'href="%s" type="application/rss+xml" />'."\n",
                       esc_param($project), href(action=>"rss"));
+               printf('<link rel="alternate" title="%s log RSS feed (no merges)" '.
+                      'href="%s" type="application/rss+xml" />'."\n",
+                      esc_param($project), href(action=>"rss",
+                                                extra_options=>"--no-merges"));
                printf('<link rel="alternate" title="%s log Atom feed" '.
                       'href="%s" type="application/atom+xml" />'."\n",
                       esc_param($project), href(action=>"atom"));
+               printf('<link rel="alternate" title="%s log Atom feed (no merges)" '.
+                      'href="%s" type="application/atom+xml" />'."\n",
+                      esc_param($project), href(action=>"atom",
+                                                extra_options=>"--no-merges"));
        } else {
                printf('<link rel="alternate" title="%s projects list" '.
                       'href="%s" type="text/plain; charset=utf-8"/>'."\n",