From 7a1d00f5deb2fae31e77ef430499352833b3ab9b Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Mon, 2 Oct 2023 02:10:13 +0300 Subject: [PATCH] fixup deps Signed-off-by: Vasiliy Tolstov --- cmd/pkgdashcli/main.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/pkgdashcli/main.go b/cmd/pkgdashcli/main.go index 9fb9547..ab7e0d6 100644 --- a/cmd/pkgdashcli/main.go +++ b/cmd/pkgdashcli/main.go @@ -278,7 +278,7 @@ func giteaPullRequest(ctx context.Context, cfg *Config, mods map[string]modules. } logger.Infof(ctx, "worktree commit") - _, err = wtree.Commit(wTitle.String(), &git.CommitOptions{ + commit, err := wtree.Commit(wTitle.String(), &git.CommitOptions{ Author: &object.Signature{ Name: "gitea-actions ", Email: "info@unistack.org", @@ -289,9 +289,10 @@ func giteaPullRequest(ctx context.Context, cfg *Config, mods map[string]modules. logger.Fatalf(ctx, "failed to commit: %v", err) } - logger.Infof(ctx, "try to push %s", newref.Name().String()) + refspec := gitconfig.RefSpec(commit.String() + ":" + newref.Name().String()) + logger.Infof(ctx, "try to push %s", refspec) if err = repo.Push(&git.PushOptions{ - RefSpecs: []gitconfig.RefSpec{gitconfig.RefSpec(newref.Name().String() + ":" + newref.Name().String())}, + RefSpecs: []gitconfig.RefSpec{refspec}, Auth: &httpauth.BasicAuth{Username: envTOKEN, Password: envTOKEN}, Force: true, }); err != nil {