mod: bump modernc.org/sqlite from 1.36.0 to 1.37.0 (#7947)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Joe Chen <jc@unknwon.io>
This commit is contained in:
dependabot[bot]
2025-04-14 18:00:07 -04:00
committed by GitHub
parent 4acaaac85a
commit 139ea3ce7d
76 changed files with 1085 additions and 1097 deletions

View File

@@ -68,7 +68,7 @@ func runHookPreReceive(c *cli.Context) error {
}
setup(c, "pre-receive.log", true)
isWiki := strings.Contains(os.Getenv(database.ENV_REPO_CUSTOM_HOOKS_PATH), ".wiki.git/")
isWiki := strings.Contains(os.Getenv(database.EnvRepoCustomHooksPath), ".wiki.git/")
buf := bytes.NewBuffer(nil)
scanner := bufio.NewScanner(os.Stdin)
@@ -89,7 +89,7 @@ func runHookPreReceive(c *cli.Context) error {
branchName := git.RefShortName(string(fields[2]))
// Branch protection
repoID := com.StrTo(os.Getenv(database.ENV_REPO_ID)).MustInt64()
repoID := com.StrTo(os.Getenv(database.EnvRepoID)).MustInt64()
protectBranch, err := database.GetProtectBranchOfRepoByName(repoID, branchName)
if err != nil {
if database.IsErrBranchNotExist(err) {
@@ -105,7 +105,7 @@ func runHookPreReceive(c *cli.Context) error {
bypassRequirePullRequest := false
// Check if user is in whitelist when enabled
userID := com.StrTo(os.Getenv(database.ENV_AUTH_USER_ID)).MustInt64()
userID := com.StrTo(os.Getenv(database.EnvAuthUserID)).MustInt64()
if protectBranch.EnableWhitelist {
if !database.IsUserInProtectBranchWhitelist(repoID, userID, branchName) {
fail(fmt.Sprintf("Branch '%s' is protected and you are not in the push whitelist", branchName), "")
@@ -126,7 +126,7 @@ func runHookPreReceive(c *cli.Context) error {
// Check force push
output, err := git.NewCommand("rev-list", "--max-count=1", oldCommitID, "^"+newCommitID).
RunInDir(database.RepoPath(os.Getenv(database.ENV_REPO_OWNER_NAME), os.Getenv(database.ENV_REPO_NAME)))
RunInDir(database.RepoPath(os.Getenv(database.EnvRepoOwnerName), os.Getenv(database.EnvRepoName)))
if err != nil {
fail("Internal error", "Failed to detect force push: %v", err)
} else if len(output) > 0 {
@@ -134,7 +134,7 @@ func runHookPreReceive(c *cli.Context) error {
}
}
customHooksPath := filepath.Join(os.Getenv(database.ENV_REPO_CUSTOM_HOOKS_PATH), "pre-receive")
customHooksPath := filepath.Join(os.Getenv(database.EnvRepoCustomHooksPath), "pre-receive")
if !com.IsFile(customHooksPath) {
return nil
}
@@ -145,7 +145,7 @@ func runHookPreReceive(c *cli.Context) error {
} else {
hookCmd = exec.Command(customHooksPath)
}
hookCmd.Dir = database.RepoPath(os.Getenv(database.ENV_REPO_OWNER_NAME), os.Getenv(database.ENV_REPO_NAME))
hookCmd.Dir = database.RepoPath(os.Getenv(database.EnvRepoOwnerName), os.Getenv(database.EnvRepoName))
hookCmd.Stdout = os.Stdout
hookCmd.Stdin = buf
hookCmd.Stderr = os.Stderr
@@ -168,7 +168,7 @@ func runHookUpdate(c *cli.Context) error {
fail("First argument 'refName' is empty", "First argument 'refName' is empty")
}
customHooksPath := filepath.Join(os.Getenv(database.ENV_REPO_CUSTOM_HOOKS_PATH), "update")
customHooksPath := filepath.Join(os.Getenv(database.EnvRepoCustomHooksPath), "update")
if !com.IsFile(customHooksPath) {
return nil
}
@@ -179,7 +179,7 @@ func runHookUpdate(c *cli.Context) error {
} else {
hookCmd = exec.Command(customHooksPath, args...)
}
hookCmd.Dir = database.RepoPath(os.Getenv(database.ENV_REPO_OWNER_NAME), os.Getenv(database.ENV_REPO_NAME))
hookCmd.Dir = database.RepoPath(os.Getenv(database.EnvRepoOwnerName), os.Getenv(database.EnvRepoName))
hookCmd.Stdout = os.Stdout
hookCmd.Stdin = os.Stdin
hookCmd.Stderr = os.Stderr
@@ -199,7 +199,7 @@ func runHookPostReceive(c *cli.Context) error {
// so we need to setup additional services for email notifications.
email.NewContext()
isWiki := strings.Contains(os.Getenv(database.ENV_REPO_CUSTOM_HOOKS_PATH), ".wiki.git/")
isWiki := strings.Contains(os.Getenv(database.EnvRepoCustomHooksPath), ".wiki.git/")
buf := bytes.NewBuffer(nil)
scanner := bufio.NewScanner(os.Stdin)
@@ -221,10 +221,10 @@ func runHookPostReceive(c *cli.Context) error {
OldCommitID: string(fields[0]),
NewCommitID: string(fields[1]),
FullRefspec: string(fields[2]),
PusherID: com.StrTo(os.Getenv(database.ENV_AUTH_USER_ID)).MustInt64(),
PusherName: os.Getenv(database.ENV_AUTH_USER_NAME),
RepoUserName: os.Getenv(database.ENV_REPO_OWNER_NAME),
RepoName: os.Getenv(database.ENV_REPO_NAME),
PusherID: com.StrTo(os.Getenv(database.EnvAuthUserID)).MustInt64(),
PusherName: os.Getenv(database.EnvAuthUserName),
RepoUserName: os.Getenv(database.EnvRepoOwnerName),
RepoName: os.Getenv(database.EnvRepoName),
}
if err := database.PushUpdate(options); err != nil {
log.Error("PushUpdate: %v", err)
@@ -233,8 +233,8 @@ func runHookPostReceive(c *cli.Context) error {
// Ask for running deliver hook and test pull request tasks
q := make(url.Values)
q.Add("branch", git.RefShortName(options.FullRefspec))
q.Add("secret", os.Getenv(database.ENV_REPO_OWNER_SALT_MD5))
q.Add("pusher", os.Getenv(database.ENV_AUTH_USER_ID))
q.Add("secret", os.Getenv(database.EnvRepoOwnerSaltMd5))
q.Add("pusher", os.Getenv(database.EnvAuthUserID))
reqURL := fmt.Sprintf("%s%s/%s/tasks/trigger?%s", conf.Server.LocalRootURL, options.RepoUserName, options.RepoName, q.Encode())
log.Trace("Trigger task: %s", reqURL)
@@ -252,7 +252,7 @@ func runHookPostReceive(c *cli.Context) error {
}
}
customHooksPath := filepath.Join(os.Getenv(database.ENV_REPO_CUSTOM_HOOKS_PATH), "post-receive")
customHooksPath := filepath.Join(os.Getenv(database.EnvRepoCustomHooksPath), "post-receive")
if !com.IsFile(customHooksPath) {
return nil
}
@@ -263,7 +263,7 @@ func runHookPostReceive(c *cli.Context) error {
} else {
hookCmd = exec.Command(customHooksPath)
}
hookCmd.Dir = database.RepoPath(os.Getenv(database.ENV_REPO_OWNER_NAME), os.Getenv(database.ENV_REPO_NAME))
hookCmd.Dir = database.RepoPath(os.Getenv(database.EnvRepoOwnerName), os.Getenv(database.EnvRepoName))
hookCmd.Stdout = os.Stdout
hookCmd.Stdin = buf
hookCmd.Stderr = os.Stderr

View File

@@ -78,12 +78,12 @@ func runImportLocale(c *cli.Context) error {
// this breaks INI parser, we need to fix that.
sr, err := os.Open(source)
if err != nil {
return fmt.Errorf("Open: %v", err)
return fmt.Errorf("open: %v", err)
}
tw, err := os.Create(target)
if err != nil {
return fmt.Errorf("Create: %v", err)
return fmt.Errorf("create: %v", err)
}
scanner := bufio.NewScanner(sr)

View File

@@ -22,7 +22,7 @@ import (
)
const (
_ACCESS_DENIED_MESSAGE = "Repository does not exist or you do not have access"
accessDeniedMessage = "Repository does not exist or you do not have access"
)
var Serv = cli.Command{
@@ -173,7 +173,7 @@ func runServ(c *cli.Context) error {
repo, err := database.GetRepositoryByName(owner.ID, repoName)
if err != nil {
if database.IsErrRepoNotExist(err) {
fail(_ACCESS_DENIED_MESSAGE, "Repository does not exist: %s/%s", owner.Name, repoName)
fail(accessDeniedMessage, "Repository does not exist: %s/%s", owner.Name, repoName)
}
fail("Internal error", "Failed to get repository: %v", err)
}
@@ -217,7 +217,7 @@ func runServ(c *cli.Context) error {
},
)
if mode < requestMode {
clientMessage := _ACCESS_DENIED_MESSAGE
clientMessage := accessDeniedMessage
if mode >= database.AccessModeRead {
clientMessage = "You do not have sufficient authorization for this action"
}

View File

@@ -107,7 +107,7 @@ func newMacaron() *macaron.Macaron {
conf.Picture.RepositoryAvatarUploadPath,
macaron.StaticOptions{
ETag: true,
Prefix: database.REPO_AVATAR_URL_PREFIX,
Prefix: database.RepoAvatarURLPrefix,
SkipLogging: conf.Server.DisableRouterLog,
},
))