-
Notifications
You must be signed in to change notification settings - Fork 3
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
Support fresh repositories (with no commits) #19
Comments
Well we won't get an exception because there's no HEAD, we'll get a |
Re calling createFromEnvironment, we can omit ref and let it default to |
Oh also, this example is kind of circular/backwards:
You wouldn't do this, createFromEnvironment taking a ref is just a way for you to set a session-level default for commands to use. It's like the If you pass a commit hash to it, like this code would, that's like checking out a commit directly and getting a detached head. You can query it just fine, but it's never gonna move forward to any new commits What you want to do is only pass a named ref to createFromEnvironment IF at the session/command level the user has specified to "open" a branch/ref to work on Then, use |
Perhaps I'm misunderstanding, but I believe what your describing does not work as intended, and throws the error I'm referring to. Steps to reproduce:
Throws error:
I believe this is because |
At the moment GitSheets has to be run against an initialised git directory with at least one commit made, so we have a bunch of
git commit -m 'init' --allow-empty
in tests/docs/etc. I believe the reason it requires at least one commit is that hologit/Repo'sgetFromEnvironment
static method is runninggit rev-parse --verify HEAD
(see here).According to @themightychris:
To which I replied:
The text was updated successfully, but these errors were encountered: