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

Gitea's models/repo.go Repository.IsBare means that a repository is Empty #5629

Closed
zeripath opened this issue Jan 4, 2019 · 3 comments · Fixed by #5714
Closed

Gitea's models/repo.go Repository.IsBare means that a repository is Empty #5629

zeripath opened this issue Jan 4, 2019 · 3 comments · Fixed by #5714
Labels
type/refactoring Existing code has been cleaned up. There should be no new functionality.
Milestone

Comments

@zeripath
Copy link
Contributor

zeripath commented Jan 4, 2019

  • Gitea version (or commit ref): master

Description

Gitea's models/repo.go Repository.IsBare means that a repository is empty rather than that the repository is actually a bare repository in git terms. This is confusing and should probably be renamed IsEmpty.

@techknowlogick techknowlogick added the type/refactoring Existing code has been cleaned up. There should be no new functionality. label Jan 5, 2019
@adelowo
Copy link
Member

adelowo commented Jan 6, 2019

I believe this can be checked with git config --get core.bare

@zeripath
Copy link
Contributor Author

zeripath commented Jan 6, 2019

It's not that it's difficult to check whether a repository is git bare but that gitea bare means something completely different from what git bare means. It's just confusing and should be called IsEmpty.

I'm not sure there are any reasons to check if a repository is bare - imho we should only ever have bare repos on the server, any use of a non bare repo should be refactored away.

I also wonder if it's really necessary to have it set on every call and whether the places that check it should just be rewritten to properly cope with empty repositories.

@lunny
Copy link
Member

lunny commented Jan 9, 2019

@zeripath yes, it's something confusing. I think Gitea's IsBare means empty or bare git.

zeripath added a commit to zeripath/gitea that referenced this issue Jan 15, 2019
Signed-off-by: Andrew Thornton <art27@cantab.net>
techknowlogick pushed a commit that referenced this issue Jan 18, 2019
* Refactor repo.isBare to repo.isEmpty #5629

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Remove Sync call
@lunny lunny added this to the 1.8.0 milestone Jan 18, 2019
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/refactoring Existing code has been cleaned up. There should be no new functionality.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants