@@ -154,7 +154,7 @@ func NewRepo(cfg GitRepoConfig) (*GitRepo, error) {
154154 }
155155
156156 log .Println ("Opening repo at" , gitDirPath )
157- repo , err := git .OpenRepository (gitDirPath )
157+ repo , err := git .Open (gitDirPath )
158158 if err != nil {
159159 return nil , err
160160 }
@@ -220,7 +220,7 @@ func (r *GitRepo) parseTags() error {
220220
221221 versions := make (map [* version.Version ]* git.Commit )
222222
223- tags , err := r .repo .GetTags ()
223+ tags , err := r .repo .Tags ()
224224 if err != nil {
225225 return fmt .Errorf ("failed to fetch tags: %s" , err .Error ())
226226 }
@@ -237,7 +237,7 @@ func (r *GitRepo) parseTags() error {
237237 continue
238238 }
239239
240- c , err := r .repo .GetCommit (commit )
240+ c , err := r .repo .CommitByRevision (commit )
241241 if err != nil {
242242 return fmt .Errorf ("error reading commit '%s': %s" , commit , err )
243243 }
@@ -300,7 +300,7 @@ func (r *GitRepo) LatestVersion() string {
300300}
301301
302302func (r * GitRepo ) retrieveBranchInfo () error {
303- id , err := r .repo .GetBranchCommitID (r .branch )
303+ id , err := r .repo .BranchCommitID (r .branch )
304304 if err != nil {
305305 return fmt .Errorf ("error getting head commit: %s " , err .Error ())
306306 }
@@ -363,22 +363,23 @@ func (r *GitRepo) calcVersion() error {
363363 return err
364364 }
365365
366- startCommit , err := r .repo .GetBranchCommit (r .branch )
366+ startCommit , err := r .repo .BranchCommit (r .branch )
367367 if err != nil {
368368 return err
369369 }
370370
371- l , err := r .repo .CommitsBetween (startCommit , r .currentTag )
371+ revList := []string {fmt .Sprintf ("%s..%s" , r .currentTag .ID , startCommit .ID )}
372+ l , err := r .repo .RevList (revList )
372373 if err != nil {
373374 log .Printf ("Error loading history for tag '%s': %s " , r .currentVersion , err .Error ())
374375 }
376+ // r.branchID is newest commit; r.currentTag.ID is oldest
375377 log .Printf ("Checking commits from %s to %s " , r .branchID , r .currentTag .ID )
376378
377379 // Sort the commits oldest to newest. Then process each commit for bumper commands.
378- for e := l .Back (); e != nil ; e = e .Prev () {
379- commit := e .Value .(* git.Commit )
380+ for _ , commit := range l {
380381 if commit == nil {
381- return fmt .Errorf ("commit pointed to nil object. This should not happen: %v" , e )
382+ return fmt .Errorf ("commit pointed to nil object. This should not happen." )
382383 }
383384
384385 v , nerr := r .parseCommit (commit )
@@ -439,7 +440,7 @@ func (r *GitRepo) tagNewVersion() error {
439440// parseCommit looks at HEAD commit see if we want to increment major/minor/patch
440441func (r * GitRepo ) parseCommit (commit * git.Commit ) (* version.Version , error ) {
441442 var b bumper
442- msg := commit .Message ()
443+ msg := commit .Message
443444 log .Printf ("Parsing %s: %s\n " , commit .ID , msg )
444445
445446 switch r .scheme {
0 commit comments