mirror of
https://github.com/go-gitea/gitea.git
synced 2025-12-16 22:15:43 +08:00
Some improvements
This commit is contained in:
parent
dec3c8cd38
commit
7ebcb24131
@ -14,6 +14,16 @@ import (
|
|||||||
"code.gitea.io/gitea/modules/process"
|
"code.gitea.io/gitea/modules/process"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// GPGSettings represents the default GPG settings for this repository
|
||||||
|
type GPGSettings struct {
|
||||||
|
Sign bool
|
||||||
|
KeyID string
|
||||||
|
Email string
|
||||||
|
Name string
|
||||||
|
PublicKeyContent string
|
||||||
|
Format string
|
||||||
|
}
|
||||||
|
|
||||||
// LoadPublicKeyContent will load the key from gpg
|
// LoadPublicKeyContent will load the key from gpg
|
||||||
func (gpgSettings *GPGSettings) LoadPublicKeyContent() error {
|
func (gpgSettings *GPGSettings) LoadPublicKeyContent() error {
|
||||||
if gpgSettings.Format == SigningKeyFormatSSH {
|
if gpgSettings.Format == SigningKeyFormatSSH {
|
||||||
|
|||||||
@ -20,16 +20,6 @@ import (
|
|||||||
"code.gitea.io/gitea/modules/proxy"
|
"code.gitea.io/gitea/modules/proxy"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GPGSettings represents the default GPG settings for this repository
|
|
||||||
type GPGSettings struct {
|
|
||||||
Sign bool
|
|
||||||
KeyID string
|
|
||||||
Email string
|
|
||||||
Name string
|
|
||||||
PublicKeyContent string
|
|
||||||
Format string
|
|
||||||
}
|
|
||||||
|
|
||||||
const prettyLogFormat = `--pretty=format:%H`
|
const prettyLogFormat = `--pretty=format:%H`
|
||||||
|
|
||||||
func (repo *Repository) ShowPrettyFormatLogToList(ctx context.Context, revisionRange string) ([]*Commit, error) {
|
func (repo *Repository) ShowPrettyFormatLogToList(ctx context.Context, revisionRange string) ([]*Commit, error) {
|
||||||
|
|||||||
@ -32,7 +32,6 @@ type Repository struct {
|
|||||||
|
|
||||||
gogitRepo *gogit.Repository
|
gogitRepo *gogit.Repository
|
||||||
gogitStorage *filesystem.Storage
|
gogitStorage *filesystem.Storage
|
||||||
gpgSettings *GPGSettings
|
|
||||||
|
|
||||||
Ctx context.Context
|
Ctx context.Context
|
||||||
LastCommitCache *LastCommitCache
|
LastCommitCache *LastCommitCache
|
||||||
|
|||||||
@ -10,8 +10,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func getSigningKey(ctx *context.APIContext, expectedFormat string) {
|
func getSigningKey(ctx *context.APIContext, expectedFormat string) {
|
||||||
// if the handler is in the repo's route group, get the repo's signing key
|
// get the global signing key
|
||||||
// otherwise, get the global signing key
|
|
||||||
content, format, err := asymkey_service.PublicSigningKey(ctx)
|
content, format, err := asymkey_service.PublicSigningKey(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ctx.APIErrorInternal(err)
|
ctx.APIErrorInternal(err)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user