Skip to content
Snippets Groups Projects

Correctly handle a FROM_SHA value of 000000...

Merged Nick Thomas requested to merge 5-fix-from-sha-zeroes into master
3 files
+ 8
7
Compare changes
  • Side-by-side
  • Inline
Files
3
+ 2
5
@@ -32,12 +32,9 @@ func NewGoGitRepository(projectPath string, fromSHA string, toSHA string) (*goGi
return nil, err
}
out.Repository = repo
out.FromHash = plumbing.NewHash(fromSHA)
if fromSHA == "" {
out.FromHash = plumbing.ZeroHash
} else {
out.FromHash = plumbing.NewHash(fromSHA)
if !out.FromHash.IsZero() {
commit, err := repo.CommitObject(out.FromHash)
if err != nil {
return nil, fmt.Errorf("Bad from SHA (%s): %s", out.FromHash, err)
Loading