File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
src/org/opensolaris/opengrok/history Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -710,11 +710,16 @@ String determineBranch() throws IOException {
710
710
String determineCurrentVersion () throws IOException {
711
711
File directory = new File (directoryName );
712
712
List <String > cmd = new ArrayList <>();
713
+ // The delimiter must not be contained in the date format emitted by
714
+ // {@code GIT_DATE_OPT}.
715
+ String delim = "#" ;
716
+
713
717
ensureCommand (CMD_PROPERTY_KEY , CMD_FALLBACK );
718
+
714
719
cmd .add (RepoCommand );
715
720
cmd .add ("log" );
716
721
cmd .add ("-1" );
717
- cmd .add ("--pretty=%cd# %h %an %s" );
722
+ cmd .add ("--pretty=%cd" + delim + " %h %an %s" );
718
723
cmd .add (GIT_DATE_OPT );
719
724
720
725
Executor executor = new Executor (cmd , directory );
@@ -723,7 +728,7 @@ String determineCurrentVersion() throws IOException {
723
728
}
724
729
725
730
String output = executor .getOutputString ().trim ();
726
- int indexOf = StringUtils .nthIndexOf (output , "#" , 1 );
731
+ int indexOf = StringUtils .nthIndexOf (output , delim , 1 );
727
732
if (indexOf < 0 ) {
728
733
throw new IOException (
729
734
String .format ("Couldn't extract date from \" %s\" ." ,
You can’t perform that action at this time.
0 commit comments