Преглед на файлове

mod: bump github.com/gogs/git-module from 1.2.0 to 1.4.0 (#6866)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Joe Chen <[email protected]>
dependabot[bot] преди 3 години
родител
ревизия
3c49a6173d

+ 1 - 1
go.mod

@@ -18,7 +18,7 @@ require (
 	github.com/go-macaron/toolbox v0.0.0-20190813233741-94defb8383c6
 	github.com/gogs/chardet v0.0.0-20150115103509-2404f7772561
 	github.com/gogs/cron v0.0.0-20171120032916-9f6c956d3e14
-	github.com/gogs/git-module v1.2.0
+	github.com/gogs/git-module v1.4.0
 	github.com/gogs/go-gogs-client v0.0.0-20200128182646-c69cb7680fd4
 	github.com/gogs/go-libravatar v0.0.0-20191106065024-33a75213d0a0
 	github.com/gogs/minwinsvc v0.0.0-20170301035411-95be6356811a

+ 2 - 2
go.sum

@@ -149,8 +149,8 @@ github.com/gogs/chardet v0.0.0-20150115103509-2404f7772561 h1:aBzukfDxQlCTVS0NBU
 github.com/gogs/chardet v0.0.0-20150115103509-2404f7772561/go.mod h1:Pcatq5tYkCW2Q6yrR2VRHlbHpZ/R4/7qyL1TCF7vl14=
 github.com/gogs/cron v0.0.0-20171120032916-9f6c956d3e14 h1:yXtpJr/LV6PFu4nTLgfjQdcMdzjbqqXMEnHfq0Or6p8=
 github.com/gogs/cron v0.0.0-20171120032916-9f6c956d3e14/go.mod h1:jPoNZLWDAqA5N3G5amEoiNbhVrmM+ZQEcnQvNQ2KaZk=
-github.com/gogs/git-module v1.2.0 h1:eetCyhSSFUkIWqES91Se9ue26fEWiRZi+eI2D13syJk=
-github.com/gogs/git-module v1.2.0/go.mod h1:oN37FFStFjdnTJXsSbhIHKJXh2YeDsEcXPATVz/oeuQ=
+github.com/gogs/git-module v1.4.0 h1:+0zcvzp3wxEMXVar2KnKmhI6JKlcAwjNUc6b5aTxs5M=
+github.com/gogs/git-module v1.4.0/go.mod h1:oN37FFStFjdnTJXsSbhIHKJXh2YeDsEcXPATVz/oeuQ=
 github.com/gogs/go-gogs-client v0.0.0-20200128182646-c69cb7680fd4 h1:C7NryI/RQhsIWwC2bHN601P1wJKeuQ6U/UCOYTn3Cic=
 github.com/gogs/go-gogs-client v0.0.0-20200128182646-c69cb7680fd4/go.mod h1:fR6z1Ie6rtF7kl/vBYMfgD5/G5B1blui7z426/sj2DU=
 github.com/gogs/go-libravatar v0.0.0-20191106065024-33a75213d0a0 h1:K02vod+sn3M1OOkdqi2tPxN2+xESK4qyITVQ3JkGEv4=

+ 1 - 1
internal/db/action.go

@@ -267,7 +267,7 @@ func (pc *PushCommits) ToApiPayloadCommits(repoPath, repoURL string) ([]*api.Pay
 			return nil, fmt.Errorf("get user by email: %v", err)
 		}
 
-		nameStatus, err := git.RepoShowNameStatus(repoPath, commit.Sha1)
+		nameStatus, err := git.ShowNameStatus(repoPath, commit.Sha1)
 		if err != nil {
 			return nil, fmt.Errorf("show name status [commit_sha1: %s]: %v", commit.Sha1, err)
 		}

+ 2 - 2
internal/db/mirror.go

@@ -128,7 +128,7 @@ func (m *Mirror) RawAddress() string {
 func (m *Mirror) SaveAddress(addr string) error {
 	repoPath := m.Repo.RepoPath()
 
-	err := git.RepoRemoveRemote(repoPath, "origin")
+	err := git.RemoteRemove(repoPath, "origin")
 	if err != nil {
 		return fmt.Errorf("remove remote 'origin': %v", err)
 	}
@@ -138,7 +138,7 @@ func (m *Mirror) SaveAddress(addr string) error {
 		return err
 	}
 
-	err = git.RepoAddRemote(repoPath, "origin", addrURL.String(), git.AddRemoteOptions{MirrorFetch: true})
+	err = git.RemoteAdd(repoPath, "origin", addrURL.String(), git.RemoteAddOptions{MirrorFetch: true})
 	if err != nil {
 		return fmt.Errorf("add remote 'origin': %v", err)
 	}

+ 4 - 4
internal/db/pull.go

@@ -634,12 +634,12 @@ func (pr *PullRequest) UpdatePatch() (err error) {
 	// Add a temporary remote.
 	tmpRemote := com.ToStr(time.Now().UnixNano())
 	baseRepoPath := RepoPath(pr.BaseRepo.MustOwner().Name, pr.BaseRepo.Name)
-	err = headGitRepo.AddRemote(tmpRemote, baseRepoPath, git.AddRemoteOptions{Fetch: true})
+	err = headGitRepo.RemoteAdd(tmpRemote, baseRepoPath, git.RemoteAddOptions{Fetch: true})
 	if err != nil {
 		return fmt.Errorf("add remote %q [repo_id: %d]: %v", tmpRemote, pr.HeadRepoID, err)
 	}
 	defer func() {
-		if err := headGitRepo.RemoveRemote(tmpRemote); err != nil {
+		if err := headGitRepo.RemoteRemove(tmpRemote); err != nil {
 			log.Error("Failed to remove remote %q [repo_id: %d]: %v", tmpRemote, pr.HeadRepoID, err)
 		}
 	}()
@@ -678,13 +678,13 @@ func (pr *PullRequest) PushToBaseRepo() (err error) {
 	}
 
 	tmpRemote := fmt.Sprintf("tmp-pull-%d", pr.ID)
-	if err = headGitRepo.AddRemote(tmpRemote, pr.BaseRepo.RepoPath()); err != nil {
+	if err = headGitRepo.RemoteAdd(tmpRemote, pr.BaseRepo.RepoPath()); err != nil {
 		return fmt.Errorf("add remote %q [repo_id: %d]: %v", tmpRemote, pr.HeadRepoID, err)
 	}
 
 	// Make sure to remove the remote even if the push fails
 	defer func() {
-		if err := headGitRepo.RemoveRemote(tmpRemote); err != nil {
+		if err := headGitRepo.RemoteRemove(tmpRemote); err != nil {
 			log.Error("Failed to remove remote %q [repo_id: %d]: %v", tmpRemote, pr.HeadRepoID, err)
 		}
 	}()

+ 3 - 3
internal/db/repo.go

@@ -419,7 +419,7 @@ func (repo *Repository) mustOwner(e Engine) *User {
 }
 
 func (repo *Repository) UpdateSize() error {
-	countObject, err := git.RepoCountObjects(repo.RepoPath())
+	countObject, err := git.CountObjects(repo.RepoPath())
 	if err != nil {
 		return fmt.Errorf("count repository objects: %v", err)
 	}
@@ -1979,7 +1979,7 @@ func GitFsck() {
 		func(idx int, bean interface{}) error {
 			repo := bean.(*Repository)
 			repoPath := repo.RepoPath()
-			err := git.RepoFsck(repoPath, git.FsckOptions{
+			err := git.Fsck(repoPath, git.FsckOptions{
 				Args:    conf.Cron.RepoHealthCheck.Args,
 				Timeout: conf.Cron.RepoHealthCheck.Timeout,
 			})
@@ -2511,7 +2511,7 @@ func (repo *Repository) CreateNewBranch(oldBranch, newBranch string) (err error)
 		return fmt.Errorf("create new branch [base: %s, new: %s]: %v", oldBranch, newBranch, err)
 	}
 
-	if err = git.RepoPush(localPath, "origin", newBranch); err != nil {
+	if err = git.Push(localPath, "origin", newBranch); err != nil {
 		return fmt.Errorf("push [branch: %s]: %v", newBranch, err)
 	}
 

+ 13 - 13
internal/db/repo_editor.go

@@ -87,7 +87,7 @@ func discardLocalRepoBranchChanges(localPath, branch string) error {
 	}
 
 	rev := "origin/" + branch
-	if err := git.RepoReset(localPath, rev, git.ResetOptions{Hard: true}); err != nil {
+	if err := git.Reset(localPath, rev, git.ResetOptions{Hard: true}); err != nil {
 		return fmt.Errorf("reset [revision: %s]: %v", rev, err)
 	}
 	return nil
@@ -99,7 +99,7 @@ func (repo *Repository) DiscardLocalRepoBranchChanges(branch string) error {
 
 // CheckoutNewBranch checks out to a new branch from the a branch name.
 func (repo *Repository) CheckoutNewBranch(oldBranch, newBranch string) error {
-	if err := git.RepoCheckout(repo.LocalCopyPath(), newBranch, git.CheckoutOptions{
+	if err := git.Checkout(repo.LocalCopyPath(), newBranch, git.CheckoutOptions{
 		BaseBranch: oldBranch,
 		Timeout:    time.Duration(conf.Git.Timeout.Pull) * time.Second,
 	}); err != nil {
@@ -141,7 +141,7 @@ func (repo *Repository) UpdateRepoFile(doer *User, opts UpdateRepoFileOptions) (
 
 		// Otherwise, delete branch from local copy in case out of sync
 		if git.RepoHasBranch(localPath, opts.NewBranch) {
-			if err = git.RepoDeleteBranch(localPath, opts.NewBranch, git.DeleteBranchOptions{
+			if err = git.DeleteBranch(localPath, opts.NewBranch, git.DeleteBranchOptions{
 				Force: true,
 			}); err != nil {
 				return fmt.Errorf("delete branch %q: %v", opts.NewBranch, err)
@@ -169,7 +169,7 @@ func (repo *Repository) UpdateRepoFile(doer *User, opts UpdateRepoFileOptions) (
 	// Ignore move step if it's a new file under a directory.
 	// Otherwise, move the file when name changed.
 	if osutil.IsFile(oldFilePath) && opts.OldTreeName != opts.NewTreeName {
-		if err = git.RepoMove(localPath, opts.OldTreeName, opts.NewTreeName); err != nil {
+		if err = git.Move(localPath, opts.OldTreeName, opts.NewTreeName); err != nil {
 			return fmt.Errorf("git mv %q %q: %v", opts.OldTreeName, opts.NewTreeName, err)
 		}
 	}
@@ -178,9 +178,9 @@ func (repo *Repository) UpdateRepoFile(doer *User, opts UpdateRepoFileOptions) (
 		return fmt.Errorf("write file: %v", err)
 	}
 
-	if err = git.RepoAdd(localPath, git.AddOptions{All: true}); err != nil {
+	if err = git.Add(localPath, git.AddOptions{All: true}); err != nil {
 		return fmt.Errorf("git add --all: %v", err)
-	} else if err = git.RepoCommit(localPath, doer.NewGitSig(), opts.Message); err != nil {
+	} else if err = git.CreateCommit(localPath, doer.NewGitSig(), opts.Message); err != nil {
 		return fmt.Errorf("commit changes on %q: %v", localPath, err)
 	}
 
@@ -192,7 +192,7 @@ func (repo *Repository) UpdateRepoFile(doer *User, opts UpdateRepoFileOptions) (
 		RepoName:  repo.Name,
 		RepoPath:  repo.RepoPath(),
 	})
-	if err = git.RepoPush(localPath, "origin", opts.NewBranch, git.PushOptions{Envs: envs}); err != nil {
+	if err = git.Push(localPath, "origin", opts.NewBranch, git.PushOptions{Envs: envs}); err != nil {
 		return fmt.Errorf("git push origin %s: %v", opts.NewBranch, err)
 	}
 	return nil
@@ -283,9 +283,9 @@ func (repo *Repository) DeleteRepoFile(doer *User, opts DeleteRepoFileOptions) (
 		return fmt.Errorf("remove file %q: %v", opts.TreePath, err)
 	}
 
-	if err = git.RepoAdd(localPath, git.AddOptions{All: true}); err != nil {
+	if err = git.Add(localPath, git.AddOptions{All: true}); err != nil {
 		return fmt.Errorf("git add --all: %v", err)
-	} else if err = git.RepoCommit(localPath, doer.NewGitSig(), opts.Message); err != nil {
+	} else if err = git.CreateCommit(localPath, doer.NewGitSig(), opts.Message); err != nil {
 		return fmt.Errorf("commit changes to %q: %v", localPath, err)
 	}
 
@@ -297,7 +297,7 @@ func (repo *Repository) DeleteRepoFile(doer *User, opts DeleteRepoFileOptions) (
 		RepoName:  repo.Name,
 		RepoPath:  repo.RepoPath(),
 	})
-	if err = git.RepoPush(localPath, "origin", opts.NewBranch, git.PushOptions{Envs: envs}); err != nil {
+	if err = git.Push(localPath, "origin", opts.NewBranch, git.PushOptions{Envs: envs}); err != nil {
 		return fmt.Errorf("git push origin %s: %v", opts.NewBranch, err)
 	}
 	return nil
@@ -507,9 +507,9 @@ func (repo *Repository) UploadRepoFiles(doer *User, opts UploadRepoFileOptions)
 		}
 	}
 
-	if err = git.RepoAdd(localPath, git.AddOptions{All: true}); err != nil {
+	if err = git.Add(localPath, git.AddOptions{All: true}); err != nil {
 		return fmt.Errorf("git add --all: %v", err)
-	} else if err = git.RepoCommit(localPath, doer.NewGitSig(), opts.Message); err != nil {
+	} else if err = git.CreateCommit(localPath, doer.NewGitSig(), opts.Message); err != nil {
 		return fmt.Errorf("commit changes on %q: %v", localPath, err)
 	}
 
@@ -521,7 +521,7 @@ func (repo *Repository) UploadRepoFiles(doer *User, opts UploadRepoFileOptions)
 		RepoName:  repo.Name,
 		RepoPath:  repo.RepoPath(),
 	})
-	if err = git.RepoPush(localPath, "origin", opts.NewBranch, git.PushOptions{Envs: envs}); err != nil {
+	if err = git.Push(localPath, "origin", opts.NewBranch, git.PushOptions{Envs: envs}); err != nil {
 		return fmt.Errorf("git push origin %s: %v", opts.NewBranch, err)
 	}
 

+ 6 - 6
internal/db/wiki.go

@@ -125,11 +125,11 @@ func (repo *Repository) updateWikiPage(doer *User, oldTitle, title, content, mes
 	if message == "" {
 		message = "Update page '" + title + "'"
 	}
-	if err = git.RepoAdd(localPath, git.AddOptions{All: true}); err != nil {
+	if err = git.Add(localPath, git.AddOptions{All: true}); err != nil {
 		return fmt.Errorf("add all changes: %v", err)
-	} else if err = git.RepoCommit(localPath, doer.NewGitSig(), message); err != nil {
+	} else if err = git.CreateCommit(localPath, doer.NewGitSig(), message); err != nil {
 		return fmt.Errorf("commit changes: %v", err)
-	} else if err = git.RepoPush(localPath, "origin", "master"); err != nil {
+	} else if err = git.Push(localPath, "origin", "master"); err != nil {
 		return fmt.Errorf("push: %v", err)
 	}
 
@@ -161,11 +161,11 @@ func (repo *Repository) DeleteWikiPage(doer *User, title string) (err error) {
 
 	message := "Delete page '" + title + "'"
 
-	if err = git.RepoAdd(localPath, git.AddOptions{All: true}); err != nil {
+	if err = git.Add(localPath, git.AddOptions{All: true}); err != nil {
 		return fmt.Errorf("add all changes: %v", err)
-	} else if err = git.RepoCommit(localPath, doer.NewGitSig(), message); err != nil {
+	} else if err = git.CreateCommit(localPath, doer.NewGitSig(), message); err != nil {
 		return fmt.Errorf("commit changes: %v", err)
-	} else if err = git.RepoPush(localPath, "origin", "master"); err != nil {
+	} else if err = git.Push(localPath, "origin", "master"); err != nil {
 		return fmt.Errorf("push: %v", err)
 	}
 

+ 16 - 16
internal/gitutil/mocks.go

@@ -13,35 +13,35 @@ import (
 var _ ModuleStore = (*MockModuleStore)(nil)
 
 type MockModuleStore struct {
-	repoAddRemote    func(repoPath, name, url string, opts ...git.AddRemoteOptions) error
-	repoDiffNameOnly func(repoPath, base, head string, opts ...git.DiffNameOnlyOptions) ([]string, error)
-	repoLog          func(repoPath, rev string, opts ...git.LogOptions) ([]*git.Commit, error)
-	repoMergeBase    func(repoPath, base, head string, opts ...git.MergeBaseOptions) (string, error)
-	repoRemoveRemote func(repoPath, name string, opts ...git.RemoveRemoteOptions) error
-	repoTags         func(repoPath string, opts ...git.TagsOptions) ([]string, error)
+	remoteAdd    func(repoPath, name, url string, opts ...git.RemoteAddOptions) error
+	diffNameOnly func(repoPath, base, head string, opts ...git.DiffNameOnlyOptions) ([]string, error)
+	log          func(repoPath, rev string, opts ...git.LogOptions) ([]*git.Commit, error)
+	mergeBase    func(repoPath, base, head string, opts ...git.MergeBaseOptions) (string, error)
+	remoteRemove func(repoPath, name string, opts ...git.RemoteRemoveOptions) error
+	repoTags     func(repoPath string, opts ...git.TagsOptions) ([]string, error)
 
 	pullRequestMeta func(headPath, basePath, headBranch, baseBranch string) (*PullRequestMeta, error)
 	listTagsAfter   func(repoPath, after string, limit int) (*TagsPage, error)
 }
 
-func (m *MockModuleStore) RepoAddRemote(repoPath, name, url string, opts ...git.AddRemoteOptions) error {
-	return m.repoAddRemote(repoPath, name, url, opts...)
+func (m *MockModuleStore) RemoteAdd(repoPath, name, url string, opts ...git.RemoteAddOptions) error {
+	return m.remoteAdd(repoPath, name, url, opts...)
 }
 
-func (m *MockModuleStore) RepoDiffNameOnly(repoPath, base, head string, opts ...git.DiffNameOnlyOptions) ([]string, error) {
-	return m.repoDiffNameOnly(repoPath, base, head, opts...)
+func (m *MockModuleStore) DiffNameOnly(repoPath, base, head string, opts ...git.DiffNameOnlyOptions) ([]string, error) {
+	return m.diffNameOnly(repoPath, base, head, opts...)
 }
 
-func (m *MockModuleStore) RepoLog(repoPath, rev string, opts ...git.LogOptions) ([]*git.Commit, error) {
-	return m.repoLog(repoPath, rev, opts...)
+func (m *MockModuleStore) Log(repoPath, rev string, opts ...git.LogOptions) ([]*git.Commit, error) {
+	return m.log(repoPath, rev, opts...)
 }
 
-func (m *MockModuleStore) RepoMergeBase(repoPath, base, head string, opts ...git.MergeBaseOptions) (string, error) {
-	return m.repoMergeBase(repoPath, base, head, opts...)
+func (m *MockModuleStore) MergeBase(repoPath, base, head string, opts ...git.MergeBaseOptions) (string, error) {
+	return m.mergeBase(repoPath, base, head, opts...)
 }
 
-func (m *MockModuleStore) RepoRemoveRemote(repoPath, name string, opts ...git.RemoveRemoteOptions) error {
-	return m.repoRemoveRemote(repoPath, name, opts...)
+func (m *MockModuleStore) RemoteRemove(repoPath, name string, opts ...git.RemoteRemoveOptions) error {
+	return m.remoteRemove(repoPath, name, opts...)
 }
 
 func (m *MockModuleStore) RepoTags(repoPath string, opts ...git.TagsOptions) ([]string, error) {

+ 25 - 23
internal/gitutil/module.go

@@ -12,23 +12,25 @@ import (
 //
 // NOTE: All methods are sorted in alphabetical order.
 type ModuleStore interface {
-	// AddRemote adds a new remote to the repository in given path.
-	RepoAddRemote(repoPath, name, url string, opts ...git.AddRemoteOptions) error
-	// RepoDiffNameOnly returns a list of changed files between base and head revisions
+	// RemoteAdd adds a new remote to the repository in given path.
+	RemoteAdd(repoPath, name, url string, opts ...git.RemoteAddOptions) error
+	// DiffNameOnly returns a list of changed files between base and head revisions
 	// of the repository in given path.
-	RepoDiffNameOnly(repoPath, base, head string, opts ...git.DiffNameOnlyOptions) ([]string, error)
-	// RepoLog returns a list of commits in the state of given revision of the repository
-	// in given path. The returned list is in reverse chronological order.
-	RepoLog(repoPath, rev string, opts ...git.LogOptions) ([]*git.Commit, error)
-	// RepoMergeBase returns merge base between base and head revisions of the repository
-	// in given path.
-	RepoMergeBase(repoPath, base, head string, opts ...git.MergeBaseOptions) (string, error)
-	// RepoRemoveRemote removes a remote from the repository in given path.
-	RepoRemoveRemote(repoPath, name string, opts ...git.RemoveRemoteOptions) error
+	DiffNameOnly(repoPath, base, head string, opts ...git.DiffNameOnlyOptions) ([]string, error)
+	// Log returns a list of commits in the state of given revision of the
+	// repository in given path. The returned list is in reverse chronological
+	// order.
+	Log(repoPath, rev string, opts ...git.LogOptions) ([]*git.Commit, error)
+	// MergeBase returns merge base between base and head revisions of the
+	// repository in given path.
+	MergeBase(repoPath, base, head string, opts ...git.MergeBaseOptions) (string, error)
+	// RemoteRemove removes a remote from the repository in given path.
+	RemoteRemove(repoPath, name string, opts ...git.RemoteRemoveOptions) error
 	// RepoTags returns a list of tags of the repository in given path.
 	RepoTags(repoPath string, opts ...git.TagsOptions) ([]string, error)
 
-	// GetPullRequestMeta gathers pull request metadata based on given head and base information.
+	// PullRequestMeta gathers pull request metadata based on given head and base
+	// information.
 	PullRequestMeta(headPath, basePath, headBranch, baseBranch string) (*PullRequestMeta, error)
 	// ListTagsAfter returns a list of tags "after" (exclusive) given tag.
 	ListTagsAfter(repoPath, after string, limit int) (*TagsPage, error)
@@ -37,24 +39,24 @@ type ModuleStore interface {
 // module holds the real implementation.
 type module struct{}
 
-func (module) RepoAddRemote(repoPath, name, url string, opts ...git.AddRemoteOptions) error {
-	return git.RepoAddRemote(repoPath, name, url, opts...)
+func (module) RemoteAdd(repoPath, name, url string, opts ...git.RemoteAddOptions) error {
+	return git.RemoteAdd(repoPath, name, url, opts...)
 }
 
-func (module) RepoDiffNameOnly(repoPath, base, head string, opts ...git.DiffNameOnlyOptions) ([]string, error) {
-	return git.RepoDiffNameOnly(repoPath, base, head, opts...)
+func (module) DiffNameOnly(repoPath, base, head string, opts ...git.DiffNameOnlyOptions) ([]string, error) {
+	return git.DiffNameOnly(repoPath, base, head, opts...)
 }
 
-func (module) RepoLog(repoPath, rev string, opts ...git.LogOptions) ([]*git.Commit, error) {
-	return git.RepoLog(repoPath, rev, opts...)
+func (module) Log(repoPath, rev string, opts ...git.LogOptions) ([]*git.Commit, error) {
+	return git.Log(repoPath, rev, opts...)
 }
 
-func (module) RepoMergeBase(repoPath, base, head string, opts ...git.MergeBaseOptions) (string, error) {
-	return git.RepoMergeBase(repoPath, base, head, opts...)
+func (module) MergeBase(repoPath, base, head string, opts ...git.MergeBaseOptions) (string, error) {
+	return git.MergeBase(repoPath, base, head, opts...)
 }
 
-func (module) RepoRemoveRemote(repoPath, name string, opts ...git.RemoveRemoteOptions) error {
-	return git.RepoRemoveRemote(repoPath, name, opts...)
+func (module) RemoteRemove(repoPath, name string, opts ...git.RemoteRemoveOptions) error {
+	return git.RemoteRemove(repoPath, name, opts...)
 }
 
 func (module) RepoTags(repoPath string, opts ...git.TagsOptions) ([]string, error) {

+ 5 - 5
internal/gitutil/pull_request.go

@@ -30,12 +30,12 @@ func (module) PullRequestMeta(headPath, basePath, headBranch, baseBranch string)
 	// We need to create a temporary remote when the pull request is sent from a forked repository.
 	if headPath != basePath {
 		tmpRemote := strconv.FormatInt(time.Now().UnixNano(), 10)
-		err := Module.RepoAddRemote(headPath, tmpRemote, basePath, git.AddRemoteOptions{Fetch: true})
+		err := Module.RemoteAdd(headPath, tmpRemote, basePath, git.RemoteAddOptions{Fetch: true})
 		if err != nil {
 			return nil, fmt.Errorf("add remote: %v", err)
 		}
 		defer func() {
-			err := Module.RepoRemoveRemote(headPath, tmpRemote)
+			err := Module.RemoteRemove(headPath, tmpRemote)
 			if err != nil {
 				log.Error("Failed to remove remote %q [path: %s]: %v", tmpRemote, headPath, err)
 				return
@@ -45,18 +45,18 @@ func (module) PullRequestMeta(headPath, basePath, headBranch, baseBranch string)
 		tmpRemoteBranch = "remotes/" + tmpRemote + "/" + baseBranch
 	}
 
-	mergeBase, err := Module.RepoMergeBase(headPath, tmpRemoteBranch, headBranch)
+	mergeBase, err := Module.MergeBase(headPath, tmpRemoteBranch, headBranch)
 	if err != nil {
 		return nil, errors.Wrap(err, "get merge base")
 	}
 
-	commits, err := Module.RepoLog(headPath, mergeBase+"..."+headBranch)
+	commits, err := Module.Log(headPath, mergeBase+"..."+headBranch)
 	if err != nil {
 		return nil, errors.Wrap(err, "get commits")
 	}
 
 	// Count number of changed files
-	names, err := Module.RepoDiffNameOnly(headPath, tmpRemoteBranch, headBranch, git.DiffNameOnlyOptions{NeedsMergeBase: true})
+	names, err := Module.DiffNameOnly(headPath, tmpRemoteBranch, headBranch, git.DiffNameOnlyOptions{NeedsMergeBase: true})
 	if err != nil {
 		return nil, errors.Wrap(err, "get changed files")
 	}

+ 5 - 5
internal/gitutil/pull_request_test.go

@@ -25,7 +25,7 @@ func TestModuler_PullRequestMeta(t *testing.T) {
 	}
 
 	SetMockModuleStore(t, &MockModuleStore{
-		repoAddRemote: func(repoPath, name, url string, opts ...git.AddRemoteOptions) error {
+		remoteAdd: func(repoPath, name, url string, opts ...git.RemoteAddOptions) error {
 			if repoPath != headPath {
 				return fmt.Errorf("repoPath: want %q but got %q", headPath, repoPath)
 			} else if name == "" {
@@ -42,7 +42,7 @@ func TestModuler_PullRequestMeta(t *testing.T) {
 
 			return nil
 		},
-		repoMergeBase: func(repoPath, base, head string, opts ...git.MergeBaseOptions) (string, error) {
+		mergeBase: func(repoPath, base, head string, opts ...git.MergeBaseOptions) (string, error) {
 			if repoPath != headPath {
 				return "", fmt.Errorf("repoPath: want %q but got %q", headPath, repoPath)
 			} else if base == "" {
@@ -53,7 +53,7 @@ func TestModuler_PullRequestMeta(t *testing.T) {
 
 			return mergeBase, nil
 		},
-		repoLog: func(repoPath, rev string, opts ...git.LogOptions) ([]*git.Commit, error) {
+		log: func(repoPath, rev string, opts ...git.LogOptions) ([]*git.Commit, error) {
 			if repoPath != headPath {
 				return nil, fmt.Errorf("repoPath: want %q but got %q", headPath, repoPath)
 			}
@@ -65,7 +65,7 @@ func TestModuler_PullRequestMeta(t *testing.T) {
 
 			return commits, nil
 		},
-		repoDiffNameOnly: func(repoPath, base, head string, opts ...git.DiffNameOnlyOptions) ([]string, error) {
+		diffNameOnly: func(repoPath, base, head string, opts ...git.DiffNameOnlyOptions) ([]string, error) {
 			if repoPath != headPath {
 				return nil, fmt.Errorf("repoPath: want %q but got %q", headPath, repoPath)
 			} else if base == "" {
@@ -82,7 +82,7 @@ func TestModuler_PullRequestMeta(t *testing.T) {
 
 			return changedFiles, nil
 		},
-		repoRemoveRemote: func(repoPath, name string, opts ...git.RemoveRemoteOptions) error {
+		remoteRemove: func(repoPath, name string, opts ...git.RemoteRemoveOptions) error {
 			if repoPath != headPath {
 				return fmt.Errorf("repoPath: want %q but got %q", headPath, repoPath)
 			} else if name == "" {