Repository navigation
Conversation
|
I left this as a draft for now just so a mantainer can check it. Since it's my first PR on this repo i dont want to make mistakes |
|
@all-contributors please add @stchigel for bug hey @stchigel thanks for this pr. it may take us a bit of time to get to this as we are working on the app right now but we will get to this soon!! |
|
I've put up a pull request to add @stchigel! 🎉 |
63d77df to
7c8014d
Compare
|
Rebased onto main and fixed import order. |
michaelfaith
left a comment
There was a problem hiding this comment.
Thanks for the contribution! It looks like there are some merge conflicts, and I do think this test would be better suited in the e2e area of tests, since it's doing a lot more than we'd generally do for unit tests 👍
7c8014d to
992c3ec
Compare
|
Rebased onto main (fixing the merge conflict) and move it to e2e as requested (while adapting it to match other e2e tests so it would work properly) |
Since all-contributors#465, spawnGitCommand has joined its arguments into one string and run it through a shell. The commit message was split on spaces, so `all-contributors add` failed with `pathspec` errors when `commit` was enabled. Paths containing spaces broke `git add` the same way, and shell metacharacters in a username or commit template were executed. Pass the arguments to execFile so each one reaches git intact. Fixes all-contributors#587 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Move the regression test for all-contributors#587 from the unit tests to the e2e tests, as it runs real git in a temporary repository. It now runs the CLI itself with `add octocat doc --commit` and checks that: - the commit is created with the whole message - the project directory can contain a space - shell metacharacters in the commit message are not executed Add a `gitProject` fixture and a `runGit` helper to support it. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
992c3ec to
d46c218
Compare
What: Fixes #587: With
"commit": true,all-contributors addfails at the commit step withpathspecerrors, leaving the files staged but not committed.Why: This is a regression from #465.
spawnGitCommandjoins its arguments into one string and runs it through a shell, which causes three problems:git addfails when the project path contains a space.autoEscapeis off (in src/util/template.js). (Confirmed this on Windows with&, did not test it on a POSIX shell)How:
spawnGitCommandnow usesexecFile('git', args), so each argument reaches git intact with no shell involved.getRemoteOriginDatastill usesexec, since its command is just a fixed string.I also ran the reproduction steps from the issue using the fixed CLI, and confirmed the fix works.
Checklist: