aboutsummaryrefslogtreecommitdiff
path: root/internal/db/lfs.go
diff options
context:
space:
mode:
authorᴜɴᴋɴᴡᴏɴ <u@gogs.io>2020-04-11 05:39:45 +0800
committerGitHub <noreply@github.com>2020-04-11 05:39:45 +0800
commit76bb647d2437dbdea86ac1a0caf5d768ab924e18 (patch)
tree94a59406f014521d17e662ba4dcf2545b6d3a5ff /internal/db/lfs.go
parente077ecdd9d95ecb76d91105b3858ee48d52c0cc2 (diff)
db: add tests for permissions (#6088)
* Add flag to print SQLs * Add tests for perms * Make results stable * codecov: only show diff * Once again, stable find results
Diffstat (limited to 'internal/db/lfs.go')
-rw-r--r--internal/db/lfs.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/internal/db/lfs.go b/internal/db/lfs.go
index 128069ed..4db2fa2d 100644
--- a/internal/db/lfs.go
+++ b/internal/db/lfs.go
@@ -30,10 +30,6 @@ type LFSStore interface {
var LFS LFSStore
-type lfs struct {
- *gorm.DB
-}
-
// LFSObject is the relation between an LFS object and a repository.
type LFSObject struct {
RepoID int64 `gorm:"PRIMARY_KEY;AUTO_INCREMENT:false"`
@@ -43,6 +39,12 @@ type LFSObject struct {
CreatedAt time.Time `gorm:"NOT NULL"`
}
+var _ LFSStore = (*lfs)(nil)
+
+type lfs struct {
+ *gorm.DB
+}
+
func (db *lfs) CreateObject(repoID int64, oid lfsutil.OID, size int64, storage lfsutil.Storage) error {
object := &LFSObject{
RepoID: repoID,