Skip to content

Commit

Permalink
change default new rev (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
Adibov authored Nov 10, 2022
1 parent 9a3dc44 commit 586db3d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ func runSemangit(cmd *cobra.Command, args []string) error {
versionAnalyzer := repo.GetVersionAnalyzer(conf.CurrentVersionAnalyzerName)
repoManager := gitrepo.NewGitRepoManger(conf.RepoDir)

if conf.OldRevision != gitrepo.RevisionNone {
repoManager.Checkout(conf.OldRevision)
if conf.NewRevision != gitrepo.RevisionNone {
repoManager.Checkout(conf.NewRevision)
}
oldVersion := utils.GetResultOrPanic(versionAnalyzer.ReadVersion(conf.RepoDir, conf.GetCurrentVersionAnalyzerArgumentValues()))
repoManager.Checkout(conf.NewRevision)
newVersion := utils.GetResultOrPanic(versionAnalyzer.ReadVersion(conf.RepoDir, conf.GetCurrentVersionAnalyzerArgumentValues()))
repoManager.Checkout(conf.OldRevision)
oldVersion := utils.GetResultOrPanic(versionAnalyzer.ReadVersion(conf.RepoDir, conf.GetCurrentVersionAnalyzerArgumentValues()))
changedFiles := repoManager.ListChangedFiles(conf.OldRevision, conf.NewRevision)
needsUpdate := versionAnalyzer.ChangeNeedsVersionUpdate(changedFiles, conf.GetCurrentVersionAnalyzerArgumentValues())
if needsUpdate && versionAnalyzer.CompareVersions(oldVersion, newVersion) >= 0 {
Expand Down

0 comments on commit 586db3d

Please sign in to comment.