File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
src/NerdBank.GitVersioning.Tests Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -794,6 +794,18 @@ public void GetVersionHeight_ProjectDirectoryIsMoved()
794794 Assert . Equal ( 1 , this . GetVersionHeight ( "new-project-dir" ) ) ;
795795 }
796796
797+ [ Fact ]
798+ public void OptimallyShortCommitId ( )
799+ {
800+ this . WriteVersionFile ( new VersionOptions { Version = SemanticVersion . Parse ( "1.2" ) , GitCommitIdShortAutoMinimum = 4 } ) ;
801+ this . InitializeSourceControl ( ) ;
802+ this . AddCommits ( 1 ) ;
803+ var oracle = new VersionOracle ( this . Context ) ;
804+
805+ // I'm not sure why libgit2 returns 7 as the minimum length when clearly a two commit repo would need fewer.
806+ Assert . Equal ( 7 , oracle . GitCommitIdShort . Length ) ;
807+ }
808+
797809 [ Fact ( Skip = "Slow test" ) ]
798810 public void GetVersionHeight_VeryLongHistory ( )
799811 {
You can’t perform that action at this time.
0 commit comments