File tree 1 file changed +9
-8
lines changed
1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -57,21 +57,22 @@ public virtual BuiltInFeatures Features
57
57
/// </summary>
58
58
public virtual string LibGit2CommitSha
59
59
{
60
- get
61
- {
62
- return ReadContentFromResource ( assembly , "libgit2_hash.txt" ) . Substring ( 0 , 7 ) ;
63
- }
60
+ get { return RetrieveAbbrevShaFrom ( "libgit2_hash.txt" ) ; }
64
61
}
65
62
66
63
/// <summary>
67
64
/// Returns the SHA hash for the LibGit2Sharp library.
68
65
/// </summary>
69
66
public virtual string LibGit2SharpCommitSha
70
67
{
71
- get
72
- {
73
- return ReadContentFromResource ( assembly , "libgit2sharp_hash.txt" ) . Substring ( 0 , 7 ) ;
74
- }
68
+ get { return RetrieveAbbrevShaFrom ( "libgit2sharp_hash.txt" ) ; }
69
+ }
70
+
71
+ private string RetrieveAbbrevShaFrom ( string name )
72
+ {
73
+ string sha = ReadContentFromResource ( assembly , name ) ?? "unknown" ;
74
+
75
+ return sha . Substring ( 0 , 7 ) ;
75
76
}
76
77
77
78
/// <summary>
You can’t perform that action at this time.
0 commit comments