Skip to content

Commit ed37f3a

Browse files
committed
Remove unnecessary code
1 parent a70ef5f commit ed37f3a

File tree

1 file changed

+1
-7
lines changed
  • routers/web/repo/setting

1 file changed

+1
-7
lines changed

routers/web/repo/setting/lfs.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,7 @@ func LFSLocks(ctx *context.Context) {
135135
}
136136
defer gitRepo.Close()
137137

138-
if err := gitRepo.ReadTreeToIndex(ctx.Repo.Repository.DefaultBranch); err != nil {
139-
log.Error("Unable to read the default branch to the index: %s (%v)", ctx.Repo.Repository.DefaultBranch, err)
140-
ctx.ServerError("LFSLocks", fmt.Errorf("unable to read the default branch to the index: %s (%w)", ctx.Repo.Repository.DefaultBranch, err))
141-
return
142-
}
143-
144-
checker, err := attribute.NewBatchChecker(gitRepo, "", "lockable")
138+
checker, err := attribute.NewBatchChecker(gitRepo, ctx.Repo.Repository.DefaultBranch, "lockable")
145139
if err != nil {
146140
log.Error("Unable to check attributes in %s (%v)", tmpBasePath, err)
147141
ctx.ServerError("LFSLocks", err)

0 commit comments

Comments
 (0)