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

use git to check that you're in a Git repository #689

Merged
merged 3 commits into from
Feb 8, 2019
Merged

use git to check that you're in a Git repository #689

merged 3 commits into from
Feb 8, 2019

Conversation

shiftkey
Copy link
Contributor

@shiftkey shiftkey commented Feb 6, 2019

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project follows, as appropriate.
  • The changes are appropriately documented (if applicable).
  • The changes have sufficient test coverage (if applicable).
  • The testsuite passes successfully on my local machine (if applicable).

Summarize your changes:

I was running v5.2.4 and electron-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 use git 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.

catches case where init-git is run within a subdirectory of a known
repository and forge should not create a nested .git directory
Copy link
Member

@MarshallOfSound MarshallOfSound left a comment

Choose a reason for hiding this comment

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

Seems legit and for some reason I feel as though I should trust You + Git 😆

@MarshallOfSound
Copy link
Member

Docs failed because PR came from fork without token cc @malept

@MarshallOfSound MarshallOfSound merged commit 72b8eea into electron:master Feb 8, 2019
@shiftkey shiftkey deleted the use-git-to-check-for-git branch February 8, 2019 18:35
dsanders11 pushed a commit that referenced this pull request Jan 14, 2023
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.

2 participants