This commit is contained in:
Gorbunov Kirill Andreevich
2024-04-08 23:49:57 +03:00
parent de2eafaac5
commit 2309bba07e
3 changed files with 40 additions and 60 deletions

View File

@@ -140,12 +140,10 @@ func (g *Github) RequestOpen(ctx context.Context, branch string, path string, mo
logger.Fatal(ctx, fmt.Sprintf("failed to get worktree: %v", err))
}
if len(g.pulls) == 0 {
g.pulls, err = GetPulls(ctx, g.URL, g.Owner, g.Repository, g.Password)
if err != nil && err != ErrPRNotExist {
logger.Error(ctx, fmt.Sprintf("GetPulls error: %s", err))
return err
}
g.pulls, err = GetPulls(ctx, g.URL, g.Owner, g.Repository, g.Password)
if err != nil {
logger.Error(ctx, fmt.Sprintf("GetPulls error: %s", err))
return err
}
for _, pull := range g.pulls {
@@ -300,12 +298,10 @@ func (g *Github) RequestList(ctx context.Context, branch string) (map[string]str
logger.Debug(ctx, fmt.Sprintf("RequestList for %s", branch))
var err error
if len(g.pulls) == 0 {
g.pulls, err = GetPulls(ctx, g.URL, g.Owner, g.Repository, g.Password)
if err != nil && err != ErrPRNotExist {
logger.Error(ctx, fmt.Sprintf("GetPulls error: %s", err))
return nil, err
}
g.pulls, err = GetPulls(ctx, g.URL, g.Owner, g.Repository, g.Password)
if err != nil {
logger.Error(ctx, fmt.Sprintf("GetPulls error: %s", err))
return nil, err
}
var path string