use git to check that you're in a Git repository #689
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summarize your changes:
I was running
v5.2.4
andelectron-forge init
to scaffold up a test project within an existing repository, and because I was running it within a subdirectory (rather than at the root of a repository) it didn't see the root.git
directory, and instead initialized a Git repository inside a Git repository.Not sure how many encounter this, but after remembering to cleanup this new
.git
directory a second time I got caremad enough to look at the code.I added some tests to cover the scenarios that I think are important here (including the failing case I found), and ported
init-git
to usegit
itself to see whether you're in a repository.Let me know if there's any extra work you'd like me to do while I'm in here, or if there's stuff I've indirectly affected.