fixup deps

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2023-10-02 22:31:23 +03:00
parent 222cde894d
commit 4cecf83b03

View File

@ -268,11 +268,6 @@ func giteaPullRequest(ctx context.Context, cfg *Config, branch string, mods map[
wBody.Reset() wBody.Reset()
logger.Infof(ctx, "update %s from %s to %s", path, mod.Module.Version, mod.Version) logger.Infof(ctx, "update %s from %s to %s", path, mod.Module.Version, mod.Version)
newref := plumbing.NewHashReference(plumbing.ReferenceName(fmt.Sprintf("refs/heads/pkgdash/go_modules/%s-%s", path, mod.Version)), headRef.Hash())
if err = repo.Storer.SetReference(newref); err != nil {
logger.Fatalf(ctx, "failed to create repo branch: %v", err)
}
logger.Infof(ctx, "reset worktree") logger.Infof(ctx, "reset worktree")
if err = wtree.Reset(&git.ResetOptions{Mode: git.HardReset}); err != nil { if err = wtree.Reset(&git.ResetOptions{Mode: git.HardReset}); err != nil {
@ -320,7 +315,7 @@ func giteaPullRequest(ctx context.Context, cfg *Config, branch string, mods map[
} }
logger.Infof(ctx, "worktree commit") logger.Infof(ctx, "worktree commit")
_, err = wtree.Commit(wTitle.String(), &git.CommitOptions{ commit, err := wtree.Commit(wTitle.String(), &git.CommitOptions{
Author: &object.Signature{ Author: &object.Signature{
Name: "gitea-actions", Name: "gitea-actions",
Email: "info@unistack.org", Email: "info@unistack.org",
@ -331,6 +326,12 @@ func giteaPullRequest(ctx context.Context, cfg *Config, branch string, mods map[
logger.Fatalf(ctx, "failed to commit: %v", err) logger.Fatalf(ctx, "failed to commit: %v", err)
} }
newref := plumbing.NewHashReference(plumbing.ReferenceName(fmt.Sprintf("refs/heads/pkgdash/go_modules/%s-%s", path, mod.Version)), commit)
if err = repo.Storer.SetReference(newref); err != nil {
logger.Fatalf(ctx, "failed to create repo branch: %v", err)
}
refspec := gitconfig.RefSpec(fmt.Sprintf("+" + newref.Name().String() + ":" + newref.Name().String())) refspec := gitconfig.RefSpec(fmt.Sprintf("+" + newref.Name().String() + ":" + newref.Name().String()))
logger.Infof(ctx, "try to push %s", refspec) logger.Infof(ctx, "try to push %s", refspec)