File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
framework/src/main/java/org/checkerframework/framework/source Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -2713,13 +2713,19 @@ private String getCheckerVersion() {
27132713 throw new BugInCF ("Could not find the version in git.properties" );
27142714 }
27152715 String branch = gitProperties .getProperty ("git.branch" );
2716- if (version .endsWith ("-SNAPSHOT" ) || !branch .equals ("master" )) {
2716+ // git.dirty indicates modified tracked files and staged changes. Untracked content doesn't
2717+ // count, so not being dirty doesn't mean that exactly the printed commit is being run.
2718+ String dirty = gitProperties .getProperty ("git.dirty" );
2719+ if (version .endsWith ("-SNAPSHOT" ) || !branch .equals ("master" ) || dirty .equals ("true" )) {
27172720 // Sometimes the branch is HEAD, which is not informative.
27182721 // How does that happen, and how can I fix it?
27192722 version += ", branch " + branch ;
27202723 // For brevity, only date but not time of day.
27212724 version += ", " + gitProperties .getProperty ("git.commit.time" ).substring (0 , 10 );
27222725 version += ", commit " + gitProperties .getProperty ("git.commit.id.abbrev" );
2726+ if (dirty .equals ("true" )) {
2727+ version += ", dirty=true" ;
2728+ }
27232729 }
27242730 return version ;
27252731 }
You can’t perform that action at this time.
0 commit comments