0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-01-18 12:17:19 +01:00

remove dead code

This commit is contained in:
wxiaoguang 2026-01-17 11:27:08 +08:00
parent c1487a7c25
commit e299f2b8cd
2 changed files with 0 additions and 19 deletions

View File

@ -67,16 +67,6 @@ func (repo *Repository) ConvertToGitID(commitID string) (ObjectID, error) {
return NewIDFromString(actualCommitID)
}
// IsCommitExist returns true if given commit exists in current repository.
func (repo *Repository) IsCommitExist(name string) bool {
hash, err := repo.ConvertToGitID(name)
if err != nil {
return false
}
_, err = repo.gogitRepo.CommitObject(plumbing.Hash(hash.RawValue()))
return err == nil
}
func (repo *Repository) getCommit(id ObjectID) (*Commit, error) {
var tagObject *object.Tag

View File

@ -50,15 +50,6 @@ func (repo *Repository) GetRefCommitID(name string) (string, error) {
return info.ID, nil
}
// IsCommitExist returns true if given commit exists in current repository.
func (repo *Repository) IsCommitExist(name string) bool {
_, _, err := gitcmd.NewCommand("cat-file", "-e").
AddDynamicArguments(name).
WithDir(repo.Path).
RunStdString(repo.Ctx)
return err == nil
}
func (repo *Repository) getCommit(id ObjectID) (*Commit, error) {
batch, cancel, err := repo.CatFileBatch(repo.Ctx)
if err != nil {