Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent git commands if project is not a git repo #301

Merged

Conversation

jonathanhefner
Copy link
Member

Prior to this commit, git commands (such as the command to get remote.origin.url) would always be run if git was installed. This caused "fatal: not a git repository" to be printed to stderr when the project was not a git repository.

This commit modifies SDoc::Helpers::Git#git? such that git commands will only be run if git is installed and the project is a git repository.

Prior to this commit, git commands (such as the command to get
`remote.origin.url`) would always be run if git was installed.  This
caused "fatal: not a git repository" to be printed to `stderr` when the
project was not a git repository.

This commit modifies `SDoc::Helpers::Git#git?` such that git commands
will only be run if git is installed _and_ the project is a git
repository.
@jonathanhefner jonathanhefner merged commit cc68136 into rails:main Sep 9, 2023
10 checks passed
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