選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

lfs_common.go 806B

1234567891011121314151617181920212223242526272829303132
  1. // Copyright 2024 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package pipeline
  4. import (
  5. "fmt"
  6. "time"
  7. "code.gitea.io/gitea/modules/git"
  8. )
  9. // LFSResult represents commits found using a provided pointer file hash
  10. type LFSResult struct {
  11. Name string
  12. SHA string
  13. Summary string
  14. When time.Time
  15. ParentHashes []git.ObjectID
  16. BranchName string
  17. FullCommitName string
  18. }
  19. type lfsResultSlice []*LFSResult
  20. func (a lfsResultSlice) Len() int { return len(a) }
  21. func (a lfsResultSlice) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
  22. func (a lfsResultSlice) Less(i, j int) bool { return a[j].When.After(a[i].When) }
  23. func lfsError(msg string, err error) error {
  24. return fmt.Errorf("LFS error occurred, %s: err: %w", msg, err)
  25. }