( ctx context.Context, repoPath string, baseRef string, headRef string, useMergeBase bool, ignoreWhitespace bool, )
| 303 | } |
| 304 | |
| 305 | func (g *Git) DiffShortStat( |
| 306 | ctx context.Context, |
| 307 | repoPath string, |
| 308 | baseRef string, |
| 309 | headRef string, |
| 310 | useMergeBase bool, |
| 311 | ignoreWhitespace bool, |
| 312 | ) (DiffShortStat, error) { |
| 313 | if repoPath == "" { |
| 314 | return DiffShortStat{}, ErrRepositoryPathEmpty |
| 315 | } |
| 316 | separator := ".." |
| 317 | if useMergeBase { |
| 318 | separator = "..." |
| 319 | } |
| 320 | |
| 321 | shortstatArgs := []string{baseRef + separator + headRef} |
| 322 | if len(baseRef) == 0 || baseRef == types.NilSHA { |
| 323 | shortstatArgs = []string{sha.EmptyTree.String(), headRef} |
| 324 | } |
| 325 | stat, err := GetDiffShortStat(ctx, repoPath, ignoreWhitespace, shortstatArgs...) |
| 326 | if err != nil { |
| 327 | return DiffShortStat{}, processGitErrorf(err, "failed to get diff short stat between %s and %s", |
| 328 | baseRef, headRef) |
| 329 | } |
| 330 | return stat, nil |
| 331 | } |
| 332 | |
| 333 | // GetDiffHunkHeaders for each file in diff output returns file name (old and new to detect renames), |
| 334 | // and all hunk headers. The diffs are generated with unified=0 parameter to create minimum sized hunks. |
nothing calls this directly
no test coverage detected