Skip to content

refactor(internal/command): add Git and Cargo command name constants#4994

Open
julieqiu wants to merge 1 commit intogoogleapis:mainfrom
julieqiu:git-cargo-constants
Open

refactor(internal/command): add Git and Cargo command name constants#4994
julieqiu wants to merge 1 commit intogoogleapis:mainfrom
julieqiu:git-cargo-constants

Conversation

@julieqiu
Copy link
Copy Markdown
Member

@julieqiu julieqiu commented Apr 1, 2026

Replace "git" and "cargo" strings with constants in the command package throughout the codebase.

Replace "git" and "cargo" with constants in the command package
throughout the codebase.
@julieqiu julieqiu requested review from a team as code owners April 1, 2026 23:35
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces Cargo and Git constants in the command package and replaces hardcoded strings with these constants throughout the codebase. Feedback suggests extending this refactoring to include the cfg.Tools key in the preFlight call for better consistency.

return err
}
gitExe := command.GetExecutablePath(cfg.Preinstalled, "git")
gitExe := command.GetExecutablePath(cfg.Preinstalled, command.Git)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For consistency with the rest of the PR, consider using the command.Cargo constant as the key for cfg.Tools when calling preFlight on line 68. Although line 68 is not directly modified in this hunk, it is part of the same logical block being refactored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant