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

Can't handle empty repositories. #127

Closed
npasserini opened this issue Sep 2, 2016 · 3 comments
Closed

Can't handle empty repositories. #127

npasserini opened this issue Sep 2, 2016 · 3 comments
Milestone

Comments

@npasserini
Copy link
Contributor

When importing an empty repository, git branch command returns an empty array, and an error is raised because our gitfiletree backend is not able to recognize the current branch.

Yet the repo has a current branch, it is not reported by the "git branch" command, so we should provide another implementation. (And tests.)

@npasserini
Copy link
Contributor Author

I think this is kind of a bug in git, a repo without commits does not behave very well. But we should be able to cope with it.

@ThierryGoubier
Copy link

I think GitFileTree avoids that by forcing, at minima, a commit with the repository properties if there is none inside the repository yet.

But I suspect this is weak (if the repository is dirty with a .filetree, then it probably fails). This would give a path to solve that.

@npasserini
Copy link
Contributor Author

Now the libgit backend has a special status with an "unborn" branch, which resembles what libgit does. It does not seem to be necessary for the gitfiletree backend, but maybe we should do the same, for consistency.

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

No branches or pull requests

2 participants