Skip to content

Commit 56ab68b

Browse files
committed
Merge remote-tracking branch 'origin/v3.5'
2 parents 4218cad + 4c54ddd commit 56ab68b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/NerdBank.GitVersioning/ManagedGit/GitRepository.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,11 @@ public static GitRepository Create(string workingDirectory, string gitDirectory,
183183
/// </returns>
184184
public static unsafe string GetString(ReadOnlySpan<byte> bytes)
185185
{
186+
if (bytes.Length == 0)
187+
{
188+
return string.Empty;
189+
}
190+
186191
fixed (byte* pBytes = bytes)
187192
{
188193
return Encoding.GetString(pBytes, bytes.Length);

0 commit comments

Comments
 (0)