-
Notifications
You must be signed in to change notification settings - Fork 66
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
Error: UnbornBranch #128
Comments
I am not as familiar with the code base, but as far as i understand, changing in src/snapshots.rs for branch name to be something else should work, but how would you want the parent commit handled? it could be made into an Option<> or maybe error handled when it is needed some other way |
Ah! Git trivia time! The parent commit is a plain list of commit hashes.
So yeah, it's as simple as giving it an empty slice. |
love your style haha |
If dura makes the first commit would that set the dura_unborn as the default branch? let head = match repo.head() {
Ok(v) => peel_to_commit(v)?,
Err(e) => if e.code() == git2::UnbornBranch {
// handle unborn branch
} else {
return Err(e);
}
}
} |
I don't know. Write a test and find out! |
I went the way of making I am thinking that once we check if head exists or not, it can be divided into 2 capture functions. Once dura makes the commit in the unborn_capture function it will have a head to use and will no longer fall back on that function. |
Repro
dura serve
cargo new
, and make changes without committingExpected behavior
This happens when there's no first commit. Normally the branch name is
dura_{base_commit_hash}
, in this case we could make it a constantdura_unborn
ordura_init
.This also means that the first commit in sequence might not have a parent, which may cause other problems.
The text was updated successfully, but these errors were encountered: