mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-05-19 16:58:09 +00:00
Compare commits
43 commits
ff7689d454
...
5f9f0a3b4b
Author | SHA1 | Date | |
---|---|---|---|
5f9f0a3b4b | |||
c06cd48219 | |||
f233603c7d | |||
d4aa1321cf | |||
c1e63bf2db | |||
4f8bf98ecd | |||
4a9316c178 | |||
eae7a48b9b | |||
bcff2538a6 | |||
d3b366ae68 | |||
38a52e28e0 | |||
092ad96059 | |||
151086a034 | |||
4d45827138 | |||
c349584c90 | |||
b2f33b8b3c | |||
4ed0a437b5 | |||
9b857c4426 | |||
e15fa0be6a | |||
4ca75f88e7 | |||
b61b061f94 | |||
5980dcba19 | |||
8407543b36 | |||
f130e5d6f9 | |||
7fc83b24b4 | |||
68d60a302c | |||
0a0faa3f60 | |||
e3f5216d32 | |||
4102e5d566 | |||
83ce1fcd7a | |||
5327bd0e05 | |||
69d2fc8459 | |||
e803c379d7 | |||
e999519d9c | |||
438321547f | |||
3594a4a3ec | |||
b8bd8b9683 | |||
d6c36ec406 | |||
20350846fc | |||
c31ae1a651 | |||
2bc226eb57 | |||
5247fd50db | |||
3dfa5ba43a |
|
@ -9,7 +9,7 @@
|
|||
|
||||
-
|
||||
|
||||
id: 2
|
||||
id: 2 # this is an LFS orphan object
|
||||
oid: 2eccdb43825d2a49d99d542daa20075cff1d97d9d2349a8977efe9c03661737c
|
||||
size: 107
|
||||
repository_id: 54
|
||||
|
|
|
@ -64,6 +64,8 @@ var migrations = []*Migration{
|
|||
NewMigration("Add repo_archive_download_count table", forgejo_v1_22.AddRepoArchiveDownloadCount),
|
||||
// v13 -> v14
|
||||
NewMigration("Add `hide_archive_links` column to `release` table", AddHideArchiveLinksToRelease),
|
||||
// v14 -> v15
|
||||
NewMigration("Remove Gitea-specific columns from the repository and badge tables", RemoveGiteaSpecificColumnsFromRepositoryAndBadge),
|
||||
}
|
||||
|
||||
// GetCurrentDBVersion returns the current Forgejo database version.
|
||||
|
|
43
models/forgejo_migrations/v14.go
Normal file
43
models/forgejo_migrations/v14.go
Normal file
|
@ -0,0 +1,43 @@
|
|||
// Copyright 2024 The Forgejo Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package forgejo_migrations //nolint:revive
|
||||
|
||||
import (
|
||||
"code.gitea.io/gitea/models/migrations/base"
|
||||
|
||||
"xorm.io/xorm"
|
||||
)
|
||||
|
||||
func RemoveGiteaSpecificColumnsFromRepositoryAndBadge(x *xorm.Engine) error {
|
||||
// Make sure the columns exist before dropping them
|
||||
type Repository struct {
|
||||
ID int64
|
||||
DefaultWikiBranch string
|
||||
}
|
||||
if err := x.Sync(&Repository{}); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
type Badge struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
Slug string
|
||||
}
|
||||
err := x.Sync(new(Badge))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
sess := x.NewSession()
|
||||
defer sess.Close()
|
||||
if err := sess.Begin(); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := base.DropTableColumns(sess, "repository", "default_wiki_branch"); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := base.DropTableColumns(sess, "badge", "slug"); err != nil {
|
||||
return err
|
||||
}
|
||||
return sess.Commit()
|
||||
}
|
|
@ -6,6 +6,7 @@ package git
|
|||
import (
|
||||
"crypto/sha1"
|
||||
"crypto/sha256"
|
||||
"hash"
|
||||
"regexp"
|
||||
"strconv"
|
||||
)
|
||||
|
@ -33,6 +34,15 @@ type ObjectFormat interface {
|
|||
ComputeHash(t ObjectType, content []byte) ObjectID
|
||||
}
|
||||
|
||||
func computeHash(dst []byte, hasher hash.Hash, t ObjectType, content []byte) []byte {
|
||||
_, _ = hasher.Write(t.Bytes())
|
||||
_, _ = hasher.Write([]byte(" "))
|
||||
_, _ = hasher.Write([]byte(strconv.Itoa(len(content))))
|
||||
_, _ = hasher.Write([]byte{0})
|
||||
_, _ = hasher.Write(content)
|
||||
return hasher.Sum(dst)
|
||||
}
|
||||
|
||||
/* SHA1 Type */
|
||||
type Sha1ObjectFormatImpl struct{}
|
||||
|
||||
|
@ -65,16 +75,9 @@ func (Sha1ObjectFormatImpl) MustID(b []byte) ObjectID {
|
|||
|
||||
// ComputeHash compute the hash for a given ObjectType and content
|
||||
func (h Sha1ObjectFormatImpl) ComputeHash(t ObjectType, content []byte) ObjectID {
|
||||
hasher := sha1.New()
|
||||
_, _ = hasher.Write(t.Bytes())
|
||||
_, _ = hasher.Write([]byte(" "))
|
||||
_, _ = hasher.Write([]byte(strconv.FormatInt(int64(len(content)), 10)))
|
||||
_, _ = hasher.Write([]byte{0})
|
||||
|
||||
// HashSum generates a SHA1 for the provided hash
|
||||
var sha1 Sha1Hash
|
||||
copy(sha1[:], hasher.Sum(nil))
|
||||
return &sha1
|
||||
var obj Sha1Hash
|
||||
computeHash(obj[:0], sha1.New(), t, content)
|
||||
return &obj
|
||||
}
|
||||
|
||||
/* SHA256 Type */
|
||||
|
@ -111,16 +114,9 @@ func (Sha256ObjectFormatImpl) MustID(b []byte) ObjectID {
|
|||
|
||||
// ComputeHash compute the hash for a given ObjectType and content
|
||||
func (h Sha256ObjectFormatImpl) ComputeHash(t ObjectType, content []byte) ObjectID {
|
||||
hasher := sha256.New()
|
||||
_, _ = hasher.Write(t.Bytes())
|
||||
_, _ = hasher.Write([]byte(" "))
|
||||
_, _ = hasher.Write([]byte(strconv.FormatInt(int64(len(content)), 10)))
|
||||
_, _ = hasher.Write([]byte{0})
|
||||
|
||||
// HashSum generates a SHA256 for the provided hash
|
||||
var sha256 Sha1Hash
|
||||
copy(sha256[:], hasher.Sum(nil))
|
||||
return &sha256
|
||||
var obj Sha256Hash
|
||||
computeHash(obj[:0], sha256.New(), t, content)
|
||||
return &obj
|
||||
}
|
||||
|
||||
var (
|
||||
|
|
|
@ -18,4 +18,8 @@ func TestIsValidSHAPattern(t *testing.T) {
|
|||
assert.False(t, h.IsValid("abc"))
|
||||
assert.False(t, h.IsValid("123g"))
|
||||
assert.False(t, h.IsValid("some random text"))
|
||||
|
||||
assert.Equal(t, "79ee38a6416c1ede423ec7ee0a8639ceea4aad22", ComputeBlobHash(Sha1ObjectFormat, []byte("some random blob")).String())
|
||||
assert.Equal(t, "d5c6407415d85df49592672aa421aed39b9db5e3", ComputeBlobHash(Sha1ObjectFormat, []byte("same length blob")).String())
|
||||
assert.Equal(t, "df0b5174ed06ae65aea40d43316bcbc21d82c9e3158ce2661df2ad28d7931dd6", ComputeBlobHash(Sha256ObjectFormat, []byte("some random blob")).String())
|
||||
}
|
||||
|
|
32
modules/git/pipeline/lfs_common.go
Normal file
32
modules/git/pipeline/lfs_common.go
Normal file
|
@ -0,0 +1,32 @@
|
|||
// Copyright 2024 The Gitea Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package pipeline
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"code.gitea.io/gitea/modules/git"
|
||||
)
|
||||
|
||||
// LFSResult represents commits found using a provided pointer file hash
|
||||
type LFSResult struct {
|
||||
Name string
|
||||
SHA string
|
||||
Summary string
|
||||
When time.Time
|
||||
ParentHashes []git.ObjectID
|
||||
BranchName string
|
||||
FullCommitName string
|
||||
}
|
||||
|
||||
type lfsResultSlice []*LFSResult
|
||||
|
||||
func (a lfsResultSlice) Len() int { return len(a) }
|
||||
func (a lfsResultSlice) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
|
||||
func (a lfsResultSlice) Less(i, j int) bool { return a[j].When.After(a[i].When) }
|
||||
|
||||
func lfsError(msg string, err error) error {
|
||||
return fmt.Errorf("LFS error occurred, %s: err: %w", msg, err)
|
||||
}
|
|
@ -7,12 +7,10 @@ package pipeline
|
|||
|
||||
import (
|
||||
"bufio"
|
||||
"fmt"
|
||||
"io"
|
||||
"sort"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"code.gitea.io/gitea/modules/git"
|
||||
|
||||
|
@ -21,23 +19,6 @@ import (
|
|||
"github.com/go-git/go-git/v5/plumbing/object"
|
||||
)
|
||||
|
||||
// LFSResult represents commits found using a provided pointer file hash
|
||||
type LFSResult struct {
|
||||
Name string
|
||||
SHA string
|
||||
Summary string
|
||||
When time.Time
|
||||
ParentHashes []git.ObjectID
|
||||
BranchName string
|
||||
FullCommitName string
|
||||
}
|
||||
|
||||
type lfsResultSlice []*LFSResult
|
||||
|
||||
func (a lfsResultSlice) Len() int { return len(a) }
|
||||
func (a lfsResultSlice) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
|
||||
func (a lfsResultSlice) Less(i, j int) bool { return a[j].When.After(a[i].When) }
|
||||
|
||||
// FindLFSFile finds commits that contain a provided pointer file hash
|
||||
func FindLFSFile(repo *git.Repository, objectID git.ObjectID) ([]*LFSResult, error) {
|
||||
resultsMap := map[string]*LFSResult{}
|
||||
|
@ -51,7 +32,7 @@ func FindLFSFile(repo *git.Repository, objectID git.ObjectID) ([]*LFSResult, err
|
|||
All: true,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Failed to get GoGit CommitsIter. Error: %w", err)
|
||||
return nil, lfsError("failed to get GoGit CommitsIter", err)
|
||||
}
|
||||
|
||||
err = commitsIter.ForEach(func(gitCommit *object.Commit) error {
|
||||
|
@ -85,7 +66,7 @@ func FindLFSFile(repo *git.Repository, objectID git.ObjectID) ([]*LFSResult, err
|
|||
return nil
|
||||
})
|
||||
if err != nil && err != io.EOF {
|
||||
return nil, fmt.Errorf("Failure in CommitIter.ForEach: %w", err)
|
||||
return nil, lfsError("failure in CommitIter.ForEach", err)
|
||||
}
|
||||
|
||||
for _, result := range resultsMap {
|
||||
|
@ -156,7 +137,7 @@ func FindLFSFile(repo *git.Repository, objectID git.ObjectID) ([]*LFSResult, err
|
|||
select {
|
||||
case err, has := <-errChan:
|
||||
if has {
|
||||
return nil, fmt.Errorf("Unable to obtain name for LFS files. Error: %w", err)
|
||||
return nil, lfsError("unable to obtain name for LFS files", err)
|
||||
}
|
||||
default:
|
||||
}
|
|
@ -8,33 +8,14 @@ package pipeline
|
|||
import (
|
||||
"bufio"
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io"
|
||||
"sort"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"code.gitea.io/gitea/modules/git"
|
||||
)
|
||||
|
||||
// LFSResult represents commits found using a provided pointer file hash
|
||||
type LFSResult struct {
|
||||
Name string
|
||||
SHA string
|
||||
Summary string
|
||||
When time.Time
|
||||
ParentIDs []git.ObjectID
|
||||
BranchName string
|
||||
FullCommitName string
|
||||
}
|
||||
|
||||
type lfsResultSlice []*LFSResult
|
||||
|
||||
func (a lfsResultSlice) Len() int { return len(a) }
|
||||
func (a lfsResultSlice) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
|
||||
func (a lfsResultSlice) Less(i, j int) bool { return a[j].When.After(a[i].When) }
|
||||
|
||||
// FindLFSFile finds commits that contain a provided pointer file hash
|
||||
func FindLFSFile(repo *git.Repository, objectID git.ObjectID) ([]*LFSResult, error) {
|
||||
resultsMap := map[string]*LFSResult{}
|
||||
|
@ -137,11 +118,11 @@ func FindLFSFile(repo *git.Repository, objectID git.ObjectID) ([]*LFSResult, err
|
|||
n += int64(count)
|
||||
if bytes.Equal(binObjectID, objectID.RawValue()) {
|
||||
result := LFSResult{
|
||||
Name: curPath + string(fname),
|
||||
SHA: curCommit.ID.String(),
|
||||
Summary: strings.Split(strings.TrimSpace(curCommit.CommitMessage), "\n")[0],
|
||||
When: curCommit.Author.When,
|
||||
ParentIDs: curCommit.Parents,
|
||||
Name: curPath + string(fname),
|
||||
SHA: curCommit.ID.String(),
|
||||
Summary: strings.Split(strings.TrimSpace(curCommit.CommitMessage), "\n")[0],
|
||||
When: curCommit.Author.When,
|
||||
ParentHashes: curCommit.Parents,
|
||||
}
|
||||
resultsMap[curCommit.ID.String()+":"+curPath+string(fname)] = &result
|
||||
} else if string(mode) == git.EntryModeTree.String() {
|
||||
|
@ -183,7 +164,7 @@ func FindLFSFile(repo *git.Repository, objectID git.ObjectID) ([]*LFSResult, err
|
|||
|
||||
for _, result := range resultsMap {
|
||||
hasParent := false
|
||||
for _, parentID := range result.ParentIDs {
|
||||
for _, parentID := range result.ParentHashes {
|
||||
if _, hasParent = resultsMap[parentID.String()+":"+result.Name]; hasParent {
|
||||
break
|
||||
}
|
||||
|
@ -241,7 +222,7 @@ func FindLFSFile(repo *git.Repository, objectID git.ObjectID) ([]*LFSResult, err
|
|||
select {
|
||||
case err, has := <-errChan:
|
||||
if has {
|
||||
return nil, fmt.Errorf("Unable to obtain name for LFS files. Error: %w", err)
|
||||
return nil, lfsError("unable to obtain name for LFS files", err)
|
||||
}
|
||||
default:
|
||||
}
|
||||
|
|
|
@ -115,14 +115,39 @@ concept_user_organization=Organisaatio
|
|||
|
||||
name=Nimi
|
||||
enable_javascript = Tämä sivu vaatii Javascriptin.
|
||||
new_project_column = Uusi sarake
|
||||
retry = Yritä uudelleen
|
||||
copy_type_unsupported = Tätä tiedostotyyppiä ei voi kopioida
|
||||
locked = Lukittu
|
||||
filter = Suodatin
|
||||
filter.is_archived = Arkistoitu
|
||||
filter.not_archived = Ei arkistoitu
|
||||
filter.public = Julkinen
|
||||
filter.private = Yksityinen
|
||||
copy_content = Kopioi sisältö
|
||||
download_logs = Lataa lokit
|
||||
show_full_screen = Näytä koko näytössä
|
||||
unknown = Tuntematon
|
||||
show_timestamps = Näytä aikaleimat
|
||||
show_log_seconds = Näytä sekunnit
|
||||
copy_generic = Kopioi leikepöydälle
|
||||
|
||||
[aria]
|
||||
footer.links = Linkit
|
||||
|
||||
[heatmap]
|
||||
less = Vähemmän
|
||||
more = Enemmän
|
||||
|
||||
[editor]
|
||||
buttons.code.tooltip = Lisää koodia
|
||||
buttons.link.tooltip = Lisää linkki
|
||||
buttons.mention.tooltip = Mainitse käyttäjä tai tiimi
|
||||
buttons.list.task.tooltip = Lisää tehtävälista
|
||||
|
||||
[filter]
|
||||
string.asc = A - Ö
|
||||
string.desc = Ö - A
|
||||
|
||||
[error]
|
||||
occurred=Virhe tapahtui
|
||||
|
|
|
@ -140,6 +140,7 @@ home = Panimula
|
|||
dashboard = Dashboard
|
||||
more_items = Higit pang mga item
|
||||
invalid_data = Hindi wastong datos: %v
|
||||
copy_generic = Kopyahin sa clipboard
|
||||
|
||||
[home]
|
||||
search_repos = Maghanap ng Repository…
|
||||
|
@ -592,6 +593,12 @@ admin_cannot_delete_self = Hindi mo maaring burahin ang sarili mo kapag isa kang
|
|||
required_prefix = Ang input ay dapat magsimula sa "%s"
|
||||
FullName = Buong pangalan
|
||||
Description = Paglalarawan
|
||||
Pronouns = Mga panghalip
|
||||
Website = Website
|
||||
To = Pangalan ng branch
|
||||
AccessToken = Token ng pag-access
|
||||
Biography = Byograpya
|
||||
Location = Lokasyon
|
||||
|
||||
[user]
|
||||
joined_on = Sumali noong %s
|
||||
|
@ -1429,6 +1436,12 @@ milestones.title = Pamagat
|
|||
milestones.desc = paglalarawan
|
||||
pulls.blocked_by_user = Hindi ka makakagawa ng [pull request] sa [repository] na ito dahil hinarang ka ng may-ari ng [repository].
|
||||
pulls.no_merge_access = Hindi ka pinapayagang isali ang [pull request] na ito.
|
||||
editor.commit_directly_to_this_branch = Direktang mag-commit sa branch na <strong class="branch-name">%s</strong>.
|
||||
editor.branch_already_exists = Umiiral na ang branch na "%s" sa repositoryo na ito.
|
||||
editor.file_editing_no_longer_exists = Ang file na ine-edit, "%s", ay hindi na umiiral sa repositoryo na ito.
|
||||
editor.filename_is_a_directory = Ang pangalan ng file "%s" ay ginagamit na bilang pangalan ng direktoryo sa repositoryo na ito.
|
||||
editor.file_is_a_symlink = `Ang %s ay isang symbolink link. Hindi mae-edit ang mga symbolic link sa web editor`
|
||||
editor.directory_is_a_file = Ang pangalan ng direktoryo "%s" ay ginagamit na bilang pangalan ng file sa repositoryo na ito.
|
||||
|
||||
[search]
|
||||
commit_kind = Maghanap ng mga commit...
|
||||
|
@ -1690,6 +1703,31 @@ repos.owner = May-ari
|
|||
repos.lfs_size = Laki ng LFS
|
||||
packages.package_manage_panel = Ipamahala ang mga package
|
||||
auths.attribute_mail = Attribute ng email
|
||||
config.server_config = Configuration ng server
|
||||
config.app_name = Pangalan ng instansya
|
||||
config.lfs_root_path = Root path ng LFS
|
||||
config.log_file_root_path = Path ng log
|
||||
config.ssh_root_path = Root path
|
||||
config.script_type = Uri ng script
|
||||
config.reverse_auth_user = Authentication user ng reverse proxy
|
||||
config.ssh_domain = Server domain ng SSH
|
||||
config.custom_conf = File path ng configuration
|
||||
config.app_url = Base URL
|
||||
config.offline_mode = Lokal na mode
|
||||
config.ssh_port = Port
|
||||
config.custom_file_root_path = Pasadyang root path ng file
|
||||
config.domain = Domain ng server
|
||||
config.disable_router_log = I-disable ang router log
|
||||
config.run_user = User na tatakbo bilang
|
||||
config.run_mode = Mode ng pagtakbo
|
||||
config.app_data_path = Path ng data ng app
|
||||
config.repo_root_path = Root path ng repositoryo
|
||||
config.ssh_config = Configuration ng SSH
|
||||
config.ssh_enabled = Naka-enable
|
||||
config.ssh_start_builtin_server = Gamitin ang built-in server
|
||||
config.ssh_listen_port = Listen port
|
||||
config.ssh_keygen_path = Path ng keygen ("ssh-keygen")
|
||||
config.ssh_key_test_path = Path ng key test
|
||||
|
||||
[org]
|
||||
repo_updated = Binago
|
||||
|
|
|
@ -423,7 +423,7 @@ twofa_scratch_used=Você usou o seu código de recuperação. Foi reencaminhado
|
|||
twofa_passcode_incorrect=A senha está errada. Se perdeu o seu dispositivo, use o código de recuperação para iniciar a sessão.
|
||||
twofa_scratch_token_incorrect=O código de recuperação está errado.
|
||||
login_userpass=Iniciar sessão
|
||||
tab_openid=
|
||||
tab_openid=OpenID
|
||||
oauth_signup_tab=Fazer inscrição
|
||||
oauth_signup_title=Completar a nova conta
|
||||
oauth_signup_submit=Completar conta
|
||||
|
@ -477,7 +477,7 @@ activate_email.text=Por favor clique na seguinte ligação para validar o seu en
|
|||
register_notify=Bem-vindo(a) ao Forgejo
|
||||
register_notify.title=%[1]s, bem-vindo(a) a %[2]s
|
||||
register_notify.text_1=este é o seu email de confirmação de registo para %s!
|
||||
register_notify.text_2=Pode iniciar a sessão usando o seu nome de utilizador: %s.
|
||||
register_notify.text_2=Pode iniciar a sessão usando o seu nome de utilizador: %s
|
||||
register_notify.text_3=Se outra pessoa criou esta conta para si, terá de <a href="%s">definir a sua senha</a> primeiro.
|
||||
|
||||
reset_password=Recupere a sua conta
|
||||
|
@ -2699,7 +2699,7 @@ settings.confirm_wiki_branch_rename = Renomear o ramo do wiki
|
|||
settings.wiki_branch_rename_success = O nome do ramo do wiki do repositório foi normalizado com sucesso.
|
||||
settings.wiki_branch_rename_failure = Falhou a normalização do nome do ramo do wiki do repositório.
|
||||
settings.add_collaborator_blocked_them = Não foi possível adicionar o colaborador porque bloquearam o/a proprietário/a do repositório.
|
||||
pulls.made_using_agit =
|
||||
pulls.made_using_agit =AGit
|
||||
settings.confirmation_string = Texto de confirmação
|
||||
settings.event_pull_request_enforcement = Execução
|
||||
pulls.blocked_by_user = Não pode criar um pedido de integração neste repositório porque foi bloqueado/a pelo/a proprietário/a do repositório.
|
||||
|
|
|
@ -61,6 +61,32 @@ concept_code_repository=儲存庫
|
|||
|
||||
|
||||
name=組織名稱
|
||||
sign_in_with_provider = 使用 %s 登入
|
||||
sign_up = 登記
|
||||
email = 電子信箱
|
||||
access_token = 訪問令牌
|
||||
powered_by = 由 %s 提供
|
||||
create_new = 建立…
|
||||
user_profile_and_more = 個人資料同埋設定…
|
||||
signed_in_as = 已經登入
|
||||
toc = 目錄
|
||||
licenses = 軟件授權
|
||||
return_to_gitea = 返來 Forgejo
|
||||
username = 用戶名
|
||||
captcha = 驗證碼
|
||||
toggle_menu = 切換選單
|
||||
webauthn_insert_key = 插入安全密鑰
|
||||
twofa = 兩步驟驗證
|
||||
webauthn_sign_in = 撳下安全密鑰嘅掣。如果安全密鑰冇掣,請再插入。
|
||||
webauthn_press_button = 請撳下安全密鑰嘅掣…
|
||||
more_items = 多啲嘢
|
||||
webauthn_use_twofa = 用手機嘅兩步驟驗證
|
||||
webauthn_error = 唔可以讀取安全密鑰。
|
||||
webauthn_unsupported_browser = 你嘅瀏覽器唔支援 WebAuthn。
|
||||
webauthn_error_unknown = 發生未知嘅錯誤,請再試下。
|
||||
webauthn_error_unable_to_process = 伺服器唔可以執行你嘅請求。
|
||||
logo = 標識
|
||||
enable_javascript = 本網站需要 JavaScript。
|
||||
|
||||
[aria]
|
||||
|
||||
|
|
|
@ -28,9 +28,13 @@ func TestGarbageCollectLFSMetaObjects(t *testing.T) {
|
|||
err := storage.Init()
|
||||
assert.NoError(t, err)
|
||||
|
||||
repo, err := repo_model.GetRepositoryByOwnerAndName(db.DefaultContext, "user2", "repo1")
|
||||
repo, err := repo_model.GetRepositoryByOwnerAndName(db.DefaultContext, "user2", "lfs")
|
||||
assert.NoError(t, err)
|
||||
|
||||
validLFSObjects, err := db.GetEngine(db.DefaultContext).Count(git_model.LFSMetaObject{RepositoryID: repo.ID})
|
||||
assert.NoError(t, err)
|
||||
assert.Greater(t, validLFSObjects, int64(1))
|
||||
|
||||
// add lfs object
|
||||
lfsContent := []byte("gitea1")
|
||||
lfsOid := storeObjectInRepo(t, repo.ID, &lfsContent)
|
||||
|
@ -39,13 +43,18 @@ func TestGarbageCollectLFSMetaObjects(t *testing.T) {
|
|||
err = repo_service.GarbageCollectLFSMetaObjects(context.Background(), repo_service.GarbageCollectLFSMetaObjectsOptions{
|
||||
AutoFix: true,
|
||||
OlderThan: time.Now().Add(7 * 24 * time.Hour).Add(5 * 24 * time.Hour),
|
||||
UpdatedLessRecentlyThan: time.Now().Add(7 * 24 * time.Hour).Add(3 * 24 * time.Hour),
|
||||
UpdatedLessRecentlyThan: time.Time{}, // ensure that the models/fixtures/lfs_meta_object.yml objects are considered as well
|
||||
LogDetail: t.Logf,
|
||||
})
|
||||
assert.NoError(t, err)
|
||||
|
||||
// lfs meta has been deleted
|
||||
_, err = git_model.GetLFSMetaObjectByOid(db.DefaultContext, repo.ID, lfsOid)
|
||||
assert.ErrorIs(t, err, git_model.ErrLFSObjectNotExist)
|
||||
|
||||
remainingLFSObjects, err := db.GetEngine(db.DefaultContext).Count(git_model.LFSMetaObject{RepositoryID: repo.ID})
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, validLFSObjects-1, remainingLFSObjects)
|
||||
}
|
||||
|
||||
func storeObjectInRepo(t *testing.T, repositoryID int64, content *[]byte) string {
|
||||
|
|
|
@ -23,9 +23,9 @@
|
|||
<span class="text grey">{{svg "octicon-git-branch"}}{{.BranchName}}</span>
|
||||
</td>
|
||||
<td>
|
||||
{{if .ParentIDs}}
|
||||
{{if .ParentHashes}}
|
||||
{{ctx.Locale.Tr "repo.diff.parent"}}
|
||||
{{range .ParentIDs}}
|
||||
{{range .ParentHashes}}
|
||||
<a class="ui primary sha label" href="{{$.RepoLink}}/commit/{{.String}}">{{ShortSha .String}}</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
|
|
Loading…
Reference in a new issue