8000 Merge branch 'pr/1452' · libgit2/libgit2sharp@2ae8428 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2ae8428

Browse files
committed
Merge branch 'pr/1452'
2 parents efdc168 + 3874dda commit 2ae8428

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

LibGit2Sharp/Version.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ private string RetrieveAbbrevShaFrom(string name)
5959
{
6060
string sha = ReadContentFromResource(assembly, name) ?? "unknown";
6161

62-
return sha.Substring(0, 7);
62+
var index = sha.Length > 7 ? 7 : sha.Length;
63+
return sha.Substring(0, index);
6364
}
6465

6566
/// <summary>

0 commit comments

Comments
 (0)
0