@@ -187,7 +187,7 @@ type Repository struct {
187187 NumReleases int `xorm:"-"`
188188
189189 IsPrivate bool `xorm:"INDEX"`
190- IsBare bool `xorm:"INDEX"`
190+ IsEmpty bool `xorm:"INDEX"`
191191
192192 IsMirror bool `xorm:"INDEX"`
193193 * Mirror `xorm:"-"`
@@ -291,7 +291,7 @@ func (repo *Repository) innerAPIFormat(e Engine, mode AccessMode, isParent bool)
291291 FullName : repo .FullName (),
292292 Description : repo .Description ,
293293 Private : repo .IsPrivate ,
294- Empty : repo .IsBare ,
294+ Empty : repo .IsEmpty ,
295295 Size : int (repo .Size / 1024 ),
296296 Fork : repo .IsFork ,
297297 Parent : parent ,
@@ -656,7 +656,7 @@ func (repo *Repository) CanUserFork(user *User) (bool, error) {
656656
657657// CanEnablePulls returns true if repository meets the requirements of accepting pulls.
658658func (repo * Repository ) CanEnablePulls () bool {
659- return ! repo .IsMirror && ! repo .IsBare
659+ return ! repo .IsMirror && ! repo .IsEmpty
660660}
661661
662662// AllowsPulls returns true if repository meets the requirements of accepting pulls and has them enabled.
@@ -954,13 +954,13 @@ func MigrateRepository(doer, u *User, opts MigrateRepoOptions) (*Repository, err
954954 _ , stderr , err := com .ExecCmdDir (repoPath , "git" , "log" , "-1" )
955955 if err != nil {
956956 if strings .Contains (stderr , "fatal: bad default revision 'HEAD'" ) {
957- repo .IsBare = true
957+ repo .IsEmpty = true
958958 } else {
959- return repo , fmt .Errorf ("check bare : %v - %s" , err , stderr )
959+ return repo , fmt .Errorf ("check empty : %v - %s" , err , stderr )
960960 }
961961 }
962962
963- if ! repo .IsBare {
963+ if ! repo .IsEmpty {
964964 // Try to get HEAD branch and set it as default branch.
965965 gitRepo , err := git .OpenRepository (repoPath )
966966 if err != nil {
@@ -999,7 +999,7 @@ func MigrateRepository(doer, u *User, opts MigrateRepoOptions) (*Repository, err
999999 repo , err = CleanUpMigrateInfo (repo )
10001000 }
10011001
1002- if err != nil && ! repo .IsBare {
1002+ if err != nil && ! repo .IsEmpty {
10031003 UpdateRepoIndexer (repo )
10041004 }
10051005
@@ -1214,7 +1214,7 @@ func initRepository(e Engine, repoPath string, u *User, repo *Repository, opts C
12141214 return fmt .Errorf ("initRepository: path already exists: %s" , repoPath )
12151215 }
12161216
1217- // Init bare new repository.
1217+ // Init git bare new repository.
12181218 if err = git .InitRepository (repoPath , true ); err != nil {
12191219 return fmt .Errorf ("InitRepository: %v" , err )
12201220 } else if err = createDelegateHooks (repoPath ); err != nil {
@@ -1249,7 +1249,7 @@ func initRepository(e Engine, repoPath string, u *User, repo *Repository, opts C
12491249 }
12501250
12511251 if ! opts .AutoInit {
1252- repo .IsBare = true
1252+ repo .IsEmpty = true
12531253 }
12541254
12551255 repo .DefaultBranch = "master"
0 commit comments