Skip to content

Commit 8f49625

Browse files
committed
Add a * to the revision in RUBY_DESCRIPTION etc when the Git repo is dirty
1 parent 2a49d2f commit 8f49625

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/shared/java/org/truffleruby/shared/TruffleRuby.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,21 @@ public static String getEngineVersion() {
4949
// The property cannot be read in a static initializer, it's set later
5050
final String systemVersion = System.getProperty("org.graalvm.version");
5151

52+
final String revisionString;
53+
if (BuildInformationImpl.INSTANCE.isDirty()) {
54+
revisionString = BuildInformationImpl.INSTANCE.getShortRevision() + "*";
55+
} else {
56+
revisionString = BuildInformationImpl.INSTANCE.getShortRevision();
57+
}
58+
5259
// No version information, or just "dev" - use 0.0-commit
5360
if (systemVersion == null || systemVersion.equals("dev")) {
54-
return "0.0-" + BuildInformationImpl.INSTANCE.getShortRevision();
61+
return "0.0-" + revisionString;
5562
}
5663

5764
// A "-dev" version number - append the commit as well
5865
if (systemVersion.endsWith("-dev")) {
59-
return systemVersion + "-" + BuildInformationImpl.INSTANCE.getShortRevision();
66+
return systemVersion + "-" + revisionString;
6067
}
6168

6269
return systemVersion;

0 commit comments

Comments
 (0)