Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

[Backport 5.0] gitserver: use -z for ListFiles#50063

Merged
keegancsmith merged 1 commit into
5.0from
backport-50023-to-5.0
Mar 28, 2023
Merged

[Backport 5.0] gitserver: use -z for ListFiles#50063
keegancsmith merged 1 commit into
5.0from
backport-50023-to-5.0

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

If you do not pass -z to git ls-tree, it will quote filenames which contain special characters. This API isn't used much, so we have never noticed this issue before (most client code uses LsFiles). However, we Cody is using this API, and that is how we noticed it. Autoindexing uses it, and likely didn't encounter issues because the pattern passed in was likely specific enough to not include filenames with special characters.

In the future we should look into unifying ListFiles and LsFiles, but they are different enough right now. Right now we copy-paste how LsFiles parses the output.

Test Plan: added a test case
Backport 9e4963f from #50023

If you do not pass -z to git ls-tree, it will quote filenames which
contain special characters. This API isn't used much, so we have never
noticed this issue before (most client code uses LsFiles). However, we
Cody is using this API, and that is how we noticed it. Autoindexing uses
it, and likely didn't encounter issues because the pattern passed in was
likely specific enough to not include filenames with special characters.

In the future we should look into unifying ListFiles and LsFiles, but
they are different enough right now. Right now we copy-paste how LsFiles
parses the output.

Test Plan: added a test case

(cherry picked from commit 9e4963f)
@github-advanced-security

Copy link
Copy Markdown

You have successfully added a new SonarCloud configuration ``. As part of the setup process, we have scanned this repository and found no existing alerts. In the future, you will see all code scanning alerts on the repository Security tab.

@sg-e2e-regression-test-bob

Copy link
Copy Markdown

Bundle size report 📦

Initial size Total size Async size Modules
1.65% (+50.90 kb) 🔺 0.02% (+3.08 kb) -0.42% (-47.81 kb) 🔽 -0.14% (-1) 🔽

Look at the Statoscope report for a full comparison between the commits d1facc7 and 530863b or learn more.

Open explanation
  • Initial size is the size of the initial bundle (the one that is loaded when you open the page)
  • Total size is the size of the initial bundle + all the async loaded chunks
  • Async size is the size of all the async loaded chunks
  • Modules is the number of modules in the initial bundle

@keegancsmith keegancsmith merged commit 1b8dfec into 5.0 Mar 28, 2023
@keegancsmith keegancsmith deleted the backport-50023-to-5.0 branch March 28, 2023 14:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants