Skip to content

Commit 6e02edf

Browse files
authored
Merge branch 'main' into fix/parentCommit
2 parents b42703f + fffc855 commit 6e02edf

File tree

105 files changed

+1447
-1173
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+1447
-1173
lines changed

.eslintrc.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ module.exports = {
403403
'github/a11y-svg-has-accessible-name': [0],
404404
'github/array-foreach': [0],
405405
'github/async-currenttarget': [2],
406-
'github/async-preventdefault': [2],
406+
'github/async-preventdefault': [0], // https://github.com/github/eslint-plugin-github/issues/599
407407
'github/authenticity-token': [0],
408408
'github/get-attribute': [0],
409409
'github/js-class-name': [0],

flake.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,14 @@
2929
poetry
3030

3131
# backend
32+
go_1_23
3233
gofumpt
3334
sqlite
3435
];
36+
shellHook = ''
37+
export GO="${pkgs.go_1_23}/bin/go"
38+
export GOROOT="${pkgs.go_1_23}/share/go"
39+
'';
3540
};
3641
}
3742
);

models/fixtures/access.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,3 +171,9 @@
171171
user_id: 40
172172
repo_id: 61
173173
mode: 4
174+
175+
-
176+
id: 30
177+
user_id: 40
178+
repo_id: 1
179+
mode: 2

models/git/branch.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,8 @@ type FindRecentlyPushedNewBranchesOptions struct {
440440
}
441441

442442
type RecentlyPushedNewBranch struct {
443+
BranchRepo *repo_model.Repository
444+
BranchName string
443445
BranchDisplayName string
444446
BranchLink string
445447
BranchCompareURL string
@@ -540,7 +542,9 @@ func FindRecentlyPushedNewBranches(ctx context.Context, doer *user_model.User, o
540542
branchDisplayName = fmt.Sprintf("%s:%s", branch.Repo.FullName(), branchDisplayName)
541543
}
542544
newBranches = append(newBranches, &RecentlyPushedNewBranch{
545+
BranchRepo: branch.Repo,
543546
BranchDisplayName: branchDisplayName,
547+
BranchName: branch.Name,
544548
BranchLink: fmt.Sprintf("%s/src/branch/%s", branch.Repo.Link(), util.PathEscapeSegments(branch.Name)),
545549
BranchCompareURL: branch.Repo.ComposeBranchCompareURL(opts.BaseRepo, branch.Name),
546550
CommitTime: branch.CommitTime,

modules/repository/branch.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ package repository
66
import (
77
"context"
88
"fmt"
9-
"strings"
109

1110
"code.gitea.io/gitea/models/db"
1211
git_model "code.gitea.io/gitea/models/git"
@@ -52,9 +51,6 @@ func SyncRepoBranchesWithRepo(ctx context.Context, repo *repo_model.Repository,
5251
{
5352
branches, _, err := gitRepo.GetBranchNames(0, 0)
5453
if err != nil {
55-
if strings.Contains(err.Error(), "ref file is empty") {
56-
return 0, nil
57-
}
5854
return 0, err
5955
}
6056
log.Trace("SyncRepoBranches[%s]: branches[%d]: %v", repo.FullName(), len(branches), branches)

modules/web/handler.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ func wrapHandlerProvider[T http.Handler](hp func(next http.Handler) T, funcInfo
121121
return func(next http.Handler) http.Handler {
122122
h := hp(next) // this handle could be dynamically generated, so we can't use it for debug info
123123
return http.HandlerFunc(func(resp http.ResponseWriter, req *http.Request) {
124-
routing.UpdateFuncInfo(req.Context(), funcInfo)
124+
defer routing.RecordFuncInfo(req.Context(), funcInfo)()
125125
h.ServeHTTP(resp, req)
126126
})
127127
}
@@ -157,7 +157,7 @@ func toHandlerProvider(handler any) func(next http.Handler) http.Handler {
157157
return // it's doing pre-check, just return
158158
}
159159

160-
routing.UpdateFuncInfo(req.Context(), funcInfo)
160+
defer routing.RecordFuncInfo(req.Context(), funcInfo)()
161161
ret := fn.Call(argsIn)
162162

163163
// handle the return value (no-op at the moment)

modules/web/routing/context.go

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,18 @@ type contextKeyType struct{}
1212

1313
var contextKey contextKeyType
1414

15-
// UpdateFuncInfo updates a context's func info
16-
func UpdateFuncInfo(ctx context.Context, funcInfo *FuncInfo) {
17-
record, ok := ctx.Value(contextKey).(*requestRecord)
18-
if !ok {
19-
return
15+
// RecordFuncInfo records a func info into context
16+
func RecordFuncInfo(ctx context.Context, funcInfo *FuncInfo) (end func()) {
17+
// TODO: reqCtx := reqctx.FromContext(ctx), add trace support
18+
end = func() {}
19+
20+
// save the func info into the context record
21+
if record, ok := ctx.Value(contextKey).(*requestRecord); ok {
22+
record.lock.Lock()
23+
record.funcInfo = funcInfo
24+
record.lock.Unlock()
2025
}
21-
22-
record.lock.Lock()
23-
record.funcInfo = funcInfo
24-
record.lock.Unlock()
26+
return end
2527
}
2628

2729
// MarkLongPolling marks the request is a long-polling request, and the logger may output different message for it

options/locale/locale_cs-CZ.ini

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1683,16 +1683,13 @@ issues.timetracker_timer_manually_add=Přidat čas
16831683

16841684
issues.time_estimate_set=Nastavit odhadovaný čas
16851685
issues.time_estimate_display=Odhad: %s
1686-
issues.change_time_estimate_at=změnil/a odhad času na <b>%s</b> %s
16871686
issues.remove_time_estimate_at=odstranil/a odhad času %s
16881687
issues.time_estimate_invalid=Formát odhadu času je neplatný
16891688
issues.start_tracking_history=započal/a práci %s
16901689
issues.tracker_auto_close=Časovač se automaticky zastaví po zavření tohoto úkolu
16911690
issues.tracking_already_started=`Již jste spustili sledování času na <a href="%s">jiném úkolu</a>!`
1692-
issues.stop_tracking_history=pracoval/a <b>%s</b> %s
16931691
issues.cancel_tracking_history=`zrušil/a sledování času %s`
16941692
issues.del_time=Odstranit tento časový záznam
1695-
issues.add_time_history=přidal/a strávený čas <b>%s</b> %s
16961693
issues.del_time_history=`odstranil/a strávený čas %s`
16971694
issues.add_time_manually=Přidat čas ručně
16981695
issues.add_time_hours=Hodiny
@@ -2155,7 +2152,6 @@ settings.advanced_settings=Pokročilá nastavení
21552152
settings.wiki_desc=Povolit Wiki repozitáře
21562153
settings.use_internal_wiki=Používat vestavěnou Wiki
21572154
settings.default_wiki_branch_name=Výchozí název větve Wiki
2158-
settings.default_wiki_everyone_access=Výchozí přístupová práva pro přihlášené uživatele:
21592155
settings.failed_to_change_default_wiki_branch=Změna výchozí větve wiki se nezdařila.
21602156
settings.use_external_wiki=Používat externí Wiki
21612157
settings.external_wiki_url=URL externí Wiki
@@ -3567,7 +3563,6 @@ conda.install=Pro instalaci balíčku pomocí Conda spusťte následující př
35673563
container.details.type=Typ obrazu
35683564
container.details.platform=Platforma
35693565
container.pull=Stáhněte obraz z příkazové řádky:
3570-
container.digest=Výběr:
35713566
container.multi_arch=OS/architektura
35723567
container.layers=Vrstvy obrazů
35733568
container.labels=Štítky

options/locale/locale_de-DE.ini

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1678,16 +1678,13 @@ issues.timetracker_timer_manually_add=Zeit hinzufügen
16781678

16791679
issues.time_estimate_set=Geschätzte Zeit festlegen
16801680
issues.time_estimate_display=Schätzung: %s
1681-
issues.change_time_estimate_at=Zeitschätzung geändert zu <b>%s</b> %s
16821681
issues.remove_time_estimate_at=Zeitschätzung %s entfernt
16831682
issues.time_estimate_invalid=Format der Zeitschätzung ist ungültig
16841683
issues.start_tracking_history=hat die Zeiterfassung %s gestartet
16851684
issues.tracker_auto_close=Der Timer wird automatisch gestoppt, wenn dieser Issue geschlossen wird
16861685
issues.tracking_already_started=`Du hast die Zeiterfassung bereits in <a href="%s">diesem Issue</a> gestartet!`
1687-
issues.stop_tracking_history=hat für <b>%s</b> gearbeitet %s
16881686
issues.cancel_tracking_history=`hat die Zeiterfassung %s abgebrochen`
16891687
issues.del_time=Diese Zeiterfassung löschen
1690-
issues.add_time_history=hat <b>%s</b> gearbeitete Zeit hinzugefügt %s
16911688
issues.del_time_history=`hat %s gearbeitete Zeit gelöscht`
16921689
issues.add_time_manually=Zeit manuell hinzufügen
16931690
issues.add_time_hours=Stunden
@@ -2151,7 +2148,6 @@ settings.advanced_settings=Erweiterte Einstellungen
21512148
settings.wiki_desc=Repository-Wiki aktivieren
21522149
settings.use_internal_wiki=Eingebautes Wiki verwenden
21532150
settings.default_wiki_branch_name=Standardbezeichnung für Wiki-Branch
2154-
settings.default_wiki_everyone_access=Standard-Zugriffsberechtigung für angemeldete Benutzer:
21552151
settings.failed_to_change_default_wiki_branch=Das Ändern des Standard-Wiki-Branches ist fehlgeschlagen.
21562152
settings.use_external_wiki=Externes Wiki verwenden
21572153
settings.external_wiki_url=Externe Wiki-URL
@@ -3556,7 +3552,6 @@ conda.install=Um das Paket mit Conda zu installieren, führe den folgenden Befeh
35563552
container.details.type=Container-Image Typ
35573553
container.details.platform=Plattform
35583554
container.pull=Downloade das Container-Image aus der Kommandozeile:
3559-
container.digest=Digest:
35603555
container.multi_arch=Betriebsystem / Architektur
35613556
container.layers=Container-Image Ebenen
35623557
container.labels=Labels

0 commit comments

Comments
 (0)