Skip to content

Commit 1443f8c

Browse files
committed
as per lafriks
Signed-off-by: Andrew Thornton <[email protected]>
1 parent f4d5dd9 commit 1443f8c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

models/repo.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1163,12 +1163,14 @@ func CreateRepository(ctx context.Context, doer, u *User, repo *Repository, over
11631163
func (repo *Repository) CheckDaemonExportOK() error {
11641164
// Create/Remove git-daemon-export-ok for git-daemon...
11651165
daemonExportFile := path.Join(repo.RepoPath(), `git-daemon-export-ok`)
1166+
11661167
isExist, err := util.IsExist(daemonExportFile)
1167-
isPublic := !repo.IsPrivate && repo.Owner.Visibility == api.VisibleTypePublic
11681168
if err != nil {
11691169
log.Error("Unable to check if %s exists. Error: %v", daemonExportFile, err)
11701170
return err
11711171
}
1172+
1173+
isPublic := !repo.IsPrivate && repo.Owner.Visibility == api.VisibleTypePublic
11721174
if !isPublic && isExist {
11731175
if err = util.Remove(daemonExportFile); err != nil {
11741176
log.Error("Failed to remove %s: %v", daemonExportFile, err)

0 commit comments

Comments
 (0)