package to.etc.testutil;

/**
 * @author <a href="mailto:jal@etc.to">Frits Jalvingh</a>
 * Created on 15-04-22.
 */
final public class TestUtil {
	private TestUtil() {}

	public static void nonTestPrintln(String text) {
		if(! inTest())
			System.out.println(text);
	}

	static public boolean inTest() {
		return System.getProperty("surefire.real.class.path") != null || System.getProperty("surefire.test.class.path") != null;
	}

}

@@ -19,16 +19,82 @@
 tutil;%0A%0A
+import java.io.BufferedReader;%0Aimport java.io.InputStreamReader;%0A%0A
 /**%0A * @
@@ -226,16 +226,18 @@
 Util() %7B
+%0A%09
 %7D%0A%0A%09publ
@@ -287,17 +287,16 @@
 %7B%0A%09%09if(!
- 
 inTest()
@@ -364,16 +364,16 @@
 est() %7B%0A
-
 %09%09return
@@ -491,10 +491,433 @@
 ll;%0A%09%7D%0A%0A
+%09static public String getGitBranch() %7B%0A%09%09try %7B%0A%09%09%09Process process = Runtime.getRuntime().exec(%22git rev-parse --abbrev-ref HEAD%22);%0A%09%09%09process.waitFor();%0A%09%09%09BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));%0A%09%09%09return reader.readLine();%0A%09%09%7D catch(Exception x) %7B%0A%09%09%09return null;%0A%09%09%7D%0A%09%7D%0A%0A%09static public void main(String%5B%5D args) %7B%0A%09%09System.out.println(%22branch: %22 + getGitBranch());%0A%09%7D%0A%0A
 %7D%0A

Add code to detect a git branch