Check whether or not a diff exists between the last reviewed diff and HEAD@{upstream}.
(ctx context.Context, cmdBuilder exe.ICmdBuilder, dir string)
| 72 | // Check whether or not a diff exists between the last reviewed diff and |
| 73 | // HEAD@{upstream}. |
| 74 | func gitHasDiff(ctx context.Context, cmdBuilder exe.ICmdBuilder, dir string) (bool, error) { |
| 75 | if gitHasLastSeenRef(ctx, cmdBuilder, dir) { |
| 76 | stdout, stderr, err := cmdBuilder.Capture( |
| 77 | cmdBuilder.BuildGitCmd(ctx, dir, "rev-parse", gitDiffRefName, "HEAD@{upstream}")) |
| 78 | if err != nil { |
| 79 | return false, fmt.Errorf("%s%w", stderr, err) |
| 80 | } |
| 81 | |
| 82 | lines := strings.Split(stdout, "\n") |
| 83 | lastseen := lines[0] |
| 84 | upstream := lines[1] |
| 85 | |
| 86 | return lastseen != upstream, nil |
| 87 | } |
| 88 | // If AUR_SEEN does not exists, we have never reviewed a diff for this package |
| 89 | // and should display it. |
| 90 | return true, nil |
| 91 | } |
| 92 | |
| 93 | // Return whether or not we have reviewed a diff yet. It checks for the existence of |
| 94 | // AUR_SEEN in the git ref-list. |
no test coverage detected