#19 change targetBranch

This commit is contained in:
Gorbunov Kirill Andreevich 2024-12-18 20:18:19 +03:00
parent 71df1f939b
commit 42fdbeba31

View File

@ -480,7 +480,7 @@ func (g Gitea) fetchCheckout(ctx context.Context, repo *git.Repository, branch,
} }
if ref.Name().Short() == branch { if ref.Name().Short() == branch {
//Получаем ссылку на нужную ветку //Получаем ссылку на нужную ветку
headRef = plumbing.NewHashReference(ref.Name(), ref.Hash()) headRef = ref
g.logger.Info(ctx, "headRef set to "+headRef.String()) g.logger.Info(ctx, "headRef set to "+headRef.String())
break break
} }
@ -526,7 +526,7 @@ func (g Gitea) fetchCheckout(ctx context.Context, repo *git.Repository, branch,
Auth: &httpauth.BasicAuth{Username: g.Username, Password: g.Password}, Auth: &httpauth.BasicAuth{Username: g.Username, Password: g.Password},
// Depth: 1, // Depth: 1,
// RemoteURL : // RemoteURL :
ReferenceName: plumbing.NewBranchReferenceName(branch), ReferenceName: headRef.Name(),
Force: true, Force: true,
RemoteName: "origin", RemoteName: "origin",
}); err != nil && err != git.NoErrAlreadyUpToDate { }); err != nil && err != git.NoErrAlreadyUpToDate {