From 42fdbeba317b57372c725d6e1eeeeb6f2122ae59 Mon Sep 17 00:00:00 2001 From: Gorbunov Kirill Andreevich Date: Wed, 18 Dec 2024 20:18:19 +0300 Subject: [PATCH] #19 change targetBranch --- internal/source/gitea/gitea.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/source/gitea/gitea.go b/internal/source/gitea/gitea.go index a4b222c..80b0baa 100644 --- a/internal/source/gitea/gitea.go +++ b/internal/source/gitea/gitea.go @@ -480,7 +480,7 @@ func (g Gitea) fetchCheckout(ctx context.Context, repo *git.Repository, branch, } if ref.Name().Short() == branch { //Получаем ссылку на нужную ветку - headRef = plumbing.NewHashReference(ref.Name(), ref.Hash()) + headRef = ref g.logger.Info(ctx, "headRef set to "+headRef.String()) 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}, // Depth: 1, // RemoteURL : - ReferenceName: plumbing.NewBranchReferenceName(branch), + ReferenceName: headRef.Name(), Force: true, RemoteName: "origin", }); err != nil && err != git.NoErrAlreadyUpToDate {