This repository was archived by the owner on Oct 20, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ public GitVersion()
4747 {
4848 Command = "rev-parse" ;
4949 Short = true ;
50+ ShortLength = 0 ;
5051 Revision = "HEAD" ;
5152 }
5253
@@ -69,6 +70,14 @@ public GitVersion()
6970 /// </value>
7071 public bool Short { get ; set ; }
7172
73+ /// <summary>
74+ /// Gets or sets a value indicating short hash length.
75+ /// </summary>
76+ /// <value>
77+ /// Length for short hash.
78+ /// </value>
79+ public int ShortLength { get ; set ; }
80+
7281 /// <summary>
7382 /// Generates the arguments.
7483 /// </summary>
@@ -78,7 +87,10 @@ protected override void GenerateArguments(CommandLineBuilder builder)
7887 builder . AppendSwitch ( "--verify" ) ;
7988
8089 if ( Short )
81- builder . AppendSwitch ( "--short" ) ;
90+ {
91+ if ( ShortLength > 0 ) builder . AppendSwitch ( "--short=" + ShortLength ) ;
92+ else builder . AppendSwitch ( "--short" ) ;
93+ }
8294
8395 base . GenerateArguments ( builder ) ;
8496
You can’t perform that action at this time.
0 commit comments