Skip to content

Allow commits on any unparented branch#355

Closed
jamill wants to merge 2 commits into
libgit2:vNextfrom
jamill:initial_commit
Closed

Allow commits on any unparented branch#355
jamill wants to merge 2 commits into
libgit2:vNextfrom
jamill:initial_commit

Conversation

@jamill

@jamill jamill commented Feb 26, 2013

Copy link
Copy Markdown
Member

LibGit2Sharp will currently only allow a commit on an "orphaned" or unparented branch if the libgit2 repository is "empty" - in particular, an initial commit is only allowed on the "master" branch.

This PR changes the condition that is checked for the initial commit to see if the current branch is orphaned.

@nulltoken

Copy link
Copy Markdown
Member

@jamill How about also deprecating the repo.Info.IsEmpty?

Do anyone use this?

/cc @spraints @haacked @carlosmn

@jamill

jamill commented Feb 26, 2013

Copy link
Copy Markdown
Member Author

@nulltoken ok - I marked the property as obsolete and removed most of the places we use this property internally. There is one place that I do not quite understand the code yet, so I left it as is for now (in CommitLog)...

@spraints

Copy link
Copy Markdown
Contributor

@nulltoken I don't see anything in git-tfs that uses repo.Info.IsEmpty.

@nulltoken

Copy link
Copy Markdown
Member

@jamill I do like this very much!

There is one place that I do not quite understand the code yet, so I left it as is for now (in CommitLog)...

This is indeed a very crappy and fragile piece of code. This comes from #30.

If you comment out the code that returns Enumerable.Empty<>, some tests should fail.

If you can think of a safer implementation, that would be awesome!

@nulltoken

Copy link
Copy Markdown
Member

Very thoughtful job! Merged. 🎱 :

If you can think of a safer implementation, that would be awesome!

The [Obsolete] warning will be in our face each time we compile. We'll tackle this later!

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.

3 participants