Fix: cargo wdk new now respects default VCS behavior
This pull request makes a small change to the arguments passed when running the cargo new command in the NewAction implementation. The --vcs none option has been removed, so the default version control system will now be used when creating new projects.
Changes
- Removed the
--vcs noneargument from thecargo newcommand inNewAction::run_cargo_new, allowing Cargo to use its default version control system when initializing new projects.
Fixes #558
Thanks for the PR @tw4. Can you please also update the tests by adding this check for the .git folder:
assert!(tmp_dir.join(&driver_name).join(".git").is_dir());
right after this line: https://github.com/microsoft/windows-drivers-rs/blob/1716d4a5d34acc0fbb1e0a4effad57530aad4bae/crates/cargo-wdk/tests/new_command_test.rs#L147
Thanks for the PR @tw4. Can you please also update the tests by adding this check for the
.gitfolder:assert!(tmp_dir.join(&driver_name).join(".git").is_dir());right after this line:
https://github.com/microsoft/windows-drivers-rs/blob/1716d4a5d34acc0fbb1e0a4effad57530aad4bae/crates/cargo-wdk/tests/new_command_test.rs#L147
Hello, thank you very much for your response. I'll add it right away.
@tw4 please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
@microsoft-github-policy-service agree [company="{your company}"]Options:
- (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
- (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@microsoft-github-policy-service agree company="Microsoft"Contributor License Agreement
@microsoft-github-policy-service agree
Thanks for the PR @tw4. The changes LGTM. I tested the changes by creating new driver packages.
In case of standalone projects, the default VCS (git) was initialized as expected.
With workspaces, I tried two scenarios:
- VCS initialized at workspace root - Driver package added via
cargo wdk newused the workspace's VCS.
- No VCS initialized at workspace root - Each Driver package added via
cargo wdk newused separate VCSs (git). Without this fix,cargo wdk newwould create new packages without VCS, which deviated fromcargo new's behavior.