chore: Add additional mocks to git package

Description

As part of Convert the `git` package into functions that c... (#7896), adding (more) mocks to the git_mock

This adds:

  • CheckoutNewBranch(branch string) error
  • UncommittedChangeCount() (int, error)
  • GitUserName() (string, error)
  • LatestCommit(ref string) (*Commit, error)
  • Commits(baseRef, headRef string) ([]*Commit, error)
  • CommitBody(sha string) (string, error)
  • Push(remote string, ref string) error
  • HasLocalBranch(branch string) (bool, error)

And makes a small change to:

  • RemoteBranchExists(remote string, branch string) (bool, error)

How has this been tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation
  • Chore (Related to CI or Packaging to platforms)
  • Test gap
Edited by Gary Holtz

Merge request reports

Loading