Skip to content

Commit

Permalink
improve implementaiton a little bit
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisStatham committed Jul 15, 2024
1 parent ea87207 commit e6fe0ef
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions internal/git/gogit/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ type Git struct {
Directory string // The (temporary) directory that should be worked within
FetchDepth int // Limit fetching to the specified number of commits

repo *git.Repository // The repository after the clone has been made

additions map[string]string // Files being added (used for GHAPI)
deletions []string // Files being remove (used for GHAPI)
repo *git.Repository // The repository after the clone has been made
oldHash string
oldHash plumbing.Hash
}

// Clone a repository
Expand Down Expand Up @@ -158,8 +159,7 @@ func (g *Git) Commit(commitAuthor *internalgit.CommitAuthor, commitMessage strin
if err != nil {
return err
}
oldHash := oldHead.Hash()
g.oldHash = oldHash.String()
g.oldHash = oldHead.Hash()

var author *object.Signature
if commitAuthor != nil {
Expand All @@ -182,7 +182,7 @@ func (g *Git) Commit(commitAuthor *internalgit.CommitAuthor, commitMessage strin
return err
}

_ = g.logDiff(oldHash, commit.Hash)
_ = g.logDiff(g.oldHash, commit.Hash)

return nil
}
Expand Down Expand Up @@ -261,7 +261,7 @@ func (g *Git) Deletions() []string {
}

func (g *Git) OldHash() string {
return g.oldHash
return g.oldHash.String()
}

// AddRemote adds a new remote
Expand Down

0 comments on commit e6fe0ef

Please sign in to comment.