From dd7111a80139f4d5c428505315a50744a2c5f304 Mon Sep 17 00:00:00 2001 From: Yongwook Choi Date: Tue, 18 Jul 2023 16:31:39 +0900 Subject: [PATCH] Fix `getVersion` to handle tag properly --- src/main/scala/esmeta/util/Git.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/esmeta/util/Git.scala b/src/main/scala/esmeta/util/Git.scala index e881013bf2..a0b67006cc 100644 --- a/src/main/scala/esmeta/util/Git.scala +++ b/src/main/scala/esmeta/util/Git.scala @@ -46,7 +46,7 @@ abstract class Git(path: String, shortHashLength: Int = 16) { self => /** get git commit version */ def getVersion(target: String): Version = val name = executeCmd(s"git name-rev --name-only $target", path).trim - val hash = executeCmd(s"git rev-parse $target", path).trim + val hash = executeCmd(s"git rev-list -n 1 $target", path).trim Version(name, hash) /** get git commit hash for the current version */