0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-12-25 15:05:35 +01:00

Use right syntax for symbolic-ref command (#21577)

Follow-up to #21352: when testing this out, I found out that the syntax
for the `symbolic-ref` command was different than originally assumed in
that PR. Never got around to submitting a PR until now.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
Clar Fon 2022-10-28 09:41:09 -04:00 committed by GitHub
parent b1dd1ba48f
commit 76e9a4f701
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -49,7 +49,7 @@ func synchronizeRepoHeads(ctx context.Context, logger log.Logger, autofix bool)
}
// otherwise, let's try fixing HEAD
err := git.NewCommand(ctx, "symbolic-ref").AddDashesAndList("HEAD", repo.DefaultBranch).Run(runOpts)
err := git.NewCommand(ctx, "symbolic-ref").AddDashesAndList("HEAD", git.BranchPrefix+repo.DefaultBranch).Run(runOpts)
if err != nil {
logger.Warn("Failed to fix HEAD for %s/%s: %v", repo.OwnerName, repo.Name, err)
return nil