fixup deps

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2023-10-02 02:00:19 +03:00
parent 6ef82b48c8
commit 4809f54b8b

View File

@ -214,6 +214,10 @@ func giteaPullRequest(ctx context.Context, cfg *Config, mods map[string]modules.
if err != nil { if err != nil {
logger.Fatalf(ctx, "failed to get repo head: %v", err) logger.Fatalf(ctx, "failed to get repo head: %v", err)
} }
wtree, err := repo.Worktree()
if err != nil {
logger.Fatalf(ctx, "failed to get worktree: %v", err)
}
for path, mod := range mods { for path, mod := range mods {
wTitle.Reset() wTitle.Reset()
@ -226,9 +230,16 @@ func giteaPullRequest(ctx context.Context, cfg *Config, mods map[string]modules.
logger.Fatalf(ctx, "failed to create repo branch: %v", err) logger.Fatalf(ctx, "failed to create repo branch: %v", err)
} }
wtree, err := repo.Worktree() if err = wtree.Reset(&git.ResetOptions{}); err != nil {
if err != nil { logger.Fatalf(ctx, "failed to reset repo branch: %v", err)
logger.Fatalf(ctx, "failed to get worktree: %v", err) }
if err = wtree.Checkout(&git.CheckoutOptions{
Branch: plumbing.NewBranchReferenceName(envBaseBranch),
Create: false,
Force: true,
}); err != nil {
logger.Fatalf(ctx, "failed to get checkout tree: %v", err)
} }
epath, err := exec.LookPath("go") epath, err := exec.LookPath("go")