Created
December 30, 2020 19:49
-
-
Save percybolmer/d0db3f04bd7eefd4c43b8f7ba66d940e to your computer and use it in GitHub Desktop.
Old isCommit to nearest
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func isCommitToNearestTag(repo *git.Repository, commit *object.Commit, tillLatest bool) bool { | |
latestTag, previousTag, err := utils.GetLatestTagFromRepository(repo) | |
if err != nil { | |
log.Fatal("Couldn't get latest tag...", err) | |
} | |
if err != nil { | |
log.Fatal("Couldn't access tag...", err) | |
} | |
if latestTag != nil { | |
if tillLatest { | |
return latestTag.Hash().String() == commit.Hash.String() | |
} | |
return previousTag.Hash().String() == commit.Hash.String() | |
} | |
return false | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment