Skip to content

Commit 586db3d

Browse files
authored
change default new rev (#10)
1 parent 9a3dc44 commit 586db3d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cmd/run.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ func runSemangit(cmd *cobra.Command, args []string) error {
1414
versionAnalyzer := repo.GetVersionAnalyzer(conf.CurrentVersionAnalyzerName)
1515
repoManager := gitrepo.NewGitRepoManger(conf.RepoDir)
1616

17-
if conf.OldRevision != gitrepo.RevisionNone {
18-
repoManager.Checkout(conf.OldRevision)
17+
if conf.NewRevision != gitrepo.RevisionNone {
18+
repoManager.Checkout(conf.NewRevision)
1919
}
20-
oldVersion := utils.GetResultOrPanic(versionAnalyzer.ReadVersion(conf.RepoDir, conf.GetCurrentVersionAnalyzerArgumentValues()))
21-
repoManager.Checkout(conf.NewRevision)
2220
newVersion := utils.GetResultOrPanic(versionAnalyzer.ReadVersion(conf.RepoDir, conf.GetCurrentVersionAnalyzerArgumentValues()))
21+
repoManager.Checkout(conf.OldRevision)
22+
oldVersion := utils.GetResultOrPanic(versionAnalyzer.ReadVersion(conf.RepoDir, conf.GetCurrentVersionAnalyzerArgumentValues()))
2323
changedFiles := repoManager.ListChangedFiles(conf.OldRevision, conf.NewRevision)
2424
needsUpdate := versionAnalyzer.ChangeNeedsVersionUpdate(changedFiles, conf.GetCurrentVersionAnalyzerArgumentValues())
2525
if needsUpdate && versionAnalyzer.CompareVersions(oldVersion, newVersion) >= 0 {

0 commit comments

Comments
 (0)