Skip to content

Commit 8375d73

Browse files
committed
add simple unit test to confirm version works w/o git.properties in classpath
1 parent 4135d34 commit 8375d73

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/java/org/apache/hadoop/fs/glusterfs/Version.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ public Version() {
2525
}
2626
}
2727
public String getTag(){
28-
return this.getProperty("git.commit.id.describe").split("-")[0];
28+
String commit = this.getProperty("git.commit.id.describe");
29+
String tag = commit != null ?
30+
commit.split("-")[0]:
31+
"no version info available. check log warnings.";
32+
return commit.split("-")[0];
2933
}
3034

3135
/**

0 commit comments

Comments
 (0)