Thread (16 messages) flat view 16 messages, 2 authors, 2016-08-11

Re: [PATCH 4/n] gitweb: Secure against commit-ish/tree-ish with the same name as path

From: Jakub Narebski <hidden>
Date: 2016-08-11 20:25:19

Jakub Narebski wrote:
quoted hunk ↗ jump to hunk
@@ -2970,7 +2972,7 @@ sub git_tree {
                }
        }
        $/ = "\0";
-       open my $fd, "-|", git_cmd(), "ls-tree", '-z', $hash
+       open my $fd, "-|", git_cmd(), "ls-tree", '-z', $hash, "--"
                or die_error(undef, "Open git-ls-tree failed");
        my @entries = map { chomp; $_ } <$fd>;
        close $fd or die_error(undef, "Reading tree failed");
Please remove this chunk from patch!. It makes gitweb "tree" view
empty. I have forgot that git-ls-tree _requires_ <tree-ish> so there
is no way to mistake pathspec with <tree-ish>.

Bit overeager adding of "--"... 
-- 
Jakub Narebski
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help