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

Closed
opened 2025-11-02 04:45:06 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @zeripath on GitHub (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.

Originally created by @zeripath on GitHub (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.
GiteaMirror added the type/refactoring label 2025-11-02 04:45:06 -06:00
Author
Owner

@adelowo commented on GitHub (Jan 6, 2019):

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

@adelowo commented on GitHub (Jan 6, 2019): I believe this can be checked with `git config --get core.bare`
Author
Owner

@zeripath commented on GitHub (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.

@zeripath commented on GitHub (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.
Author
Owner

@lunny commented on GitHub (Jan 9, 2019):

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

@lunny commented on GitHub (Jan 9, 2019): @zeripath yes, it's something confusing. I think Gitea's IsBare means `empty or bare git`.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#2705