aboutsummaryrefslogtreecommitdiffstats
path: root/modules/gitrepo/branch.go
diff options
context:
space:
mode:
authorTheFox0x7 <thefox0x7@gmail.com>2025-03-04 20:56:11 +0100
committerGitHub <noreply@github.com>2025-03-04 11:56:11 -0800
commitae3a18e01a10520f5e12255304c7a9bbb246c41e (patch)
tree58494c1e9ae3ac68e773efdcfcb98a961d56914a /modules/gitrepo/branch.go
parent6c8fb8d455cfe25d5aa966674624bce99fba1735 (diff)
downloadgitea-ae3a18e01a10520f5e12255304c7a9bbb246c41e.tar.gz
gitea-ae3a18e01a10520f5e12255304c7a9bbb246c41e.zip
Remove context from git struct (#33793)
Argument is moved from struct init in command run, which lets us remove context from struct.
Diffstat (limited to 'modules/gitrepo/branch.go')
-rw-r--r--modules/gitrepo/branch.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/gitrepo/branch.go b/modules/gitrepo/branch.go
index e13a4c82e1..3336036248 100644
--- a/modules/gitrepo/branch.go
+++ b/modules/gitrepo/branch.go
@@ -33,9 +33,9 @@ func GetBranchCommitID(ctx context.Context, repo Repository, branch string) (str
// SetDefaultBranch sets default branch of repository.
func SetDefaultBranch(ctx context.Context, repo Repository, name string) error {
- _, _, err := git.NewCommand(ctx, "symbolic-ref", "HEAD").
- AddDynamicArguments(git.BranchPrefix + name).
- RunStdString(&git.RunOpts{Dir: repoPath(repo)})
+ _, _, err := git.NewCommand("symbolic-ref", "HEAD").
+ AddDynamicArguments(git.BranchPrefix+name).
+ RunStdString(ctx, &git.RunOpts{Dir: repoPath(repo)})
return err
}