-
Notifications
You must be signed in to change notification settings - Fork 292
Initialise git repo in new app #3197
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
Conversation
crates/templates/src/git.rs
Outdated
| .stdout(Stdio::null()) | ||
| .stderr(Stdio::null()); | ||
|
|
||
| let status = cmd.status().await?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: use of context would likely help here as the error message from the status call is likely to not be very helpful out of context.
crates/templates/src/run.rs
Outdated
| } | ||
| } | ||
|
|
||
| async fn initialise_git(&self) -> anyhow::Result<()> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit:
| async fn initialise_git(&self) -> anyhow::Result<()> { | |
| async fn maybe_initialise_git(&self) -> anyhow::Result<()> { |
|
|
||
| let target_dir = self.generation_target_dir(); | ||
|
|
||
| let skip_initing_repo = git::is_in_git_repo(&target_dir).await.unwrap_or(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we warn if is_in_git_repo errors?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say not: we don't want to error on "git not installed," and other cases seem unlikely. We could trace or something if you feel strongly?
iamrajiv
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm sorry i missed the notice for the review comment @itowlson thanks for the fix
|
@itowlson Rebasing on main will fix the CI errors now |
Signed-off-by: itowlson <[email protected]>
9e409e0 to
44ab8b2
Compare
Fixes #2580
This picks up on work done in #3155 by @iamrajiv. The core of that PR was fine, but unfortunately there were some unrelated blocking problems, and the PR has since gone inactive.