@@ -49,6 +49,8 @@ public class DescribeResult {
4949 private boolean dirty ;
5050 private String dirtyMarker ;
5151
52+ private boolean forceLongFormat ;
53+
5254 private ObjectReader objectReader ;
5355
5456 public static final DescribeResult EMPTY = new DescribeResult ("" );
@@ -58,7 +60,7 @@ public DescribeResult(@NotNull String tagName) {
5860 }
5961
6062 public DescribeResult (@ NotNull ObjectReader objectReader , String tagName , int commitsAwayFromTag , @ Nullable ObjectId commitId ) {
61- this (objectReader , tagName , commitsAwayFromTag , commitId , false , Optional .<String >absent ());
63+ this (objectReader , tagName , commitsAwayFromTag , commitId , false , Optional .<String >absent (), false );
6264 }
6365
6466 public DescribeResult (@ NotNull ObjectReader objectReader , @ NotNull ObjectId commitId ) {
@@ -69,13 +71,14 @@ public DescribeResult(@NotNull ObjectReader objectReader, @NotNull ObjectId comm
6971 }
7072
7173 public DescribeResult (@ NotNull ObjectReader objectReader , String tagName , int commitsAwayFromTag , ObjectId commitId , boolean dirty , String dirtyMarker ) {
72- this (objectReader , tagName , commitsAwayFromTag , commitId , dirty , Optional .of (dirtyMarker ));
74+ this (objectReader , tagName , commitsAwayFromTag , commitId , dirty , Optional .of (dirtyMarker ), false );
7375 }
7476
75- public DescribeResult (@ NotNull ObjectReader objectReader , String tagName , int commitsAwayFromTag , ObjectId commitId , boolean dirty , Optional <String > dirtyMarker ) {
77+ public DescribeResult (@ NotNull ObjectReader objectReader , String tagName , int commitsAwayFromTag , ObjectId commitId , boolean dirty , Optional <String > dirtyMarker , boolean forceLongFormat ) {
7678 this (objectReader , commitId , dirty , dirtyMarker );
7779 this .tagName = Optional .of (tagName );
7880 this .commitsAwayFromTag = commitsAwayFromTag ;
81+ this .forceLongFormat = forceLongFormat ;
7982 }
8083
8184 public DescribeResult (@ NotNull ObjectReader objectReader , @ NotNull ObjectId commitId , boolean dirty , @ NotNull Optional <String > dirtyMarker ) {
@@ -145,6 +148,9 @@ private boolean abbrevZeroHidesCommitsPartOfDescribe() {
145148
146149 @ Nullable
147150 public String commitsAwayFromTag () {
151+ if (forceLongFormat ) {
152+ return String .valueOf (commitsAwayFromTag );
153+ }
148154 return commitsAwayFromTag == 0 ? null : String .valueOf (commitsAwayFromTag );
149155 }
150156
0 commit comments