File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -152,7 +152,17 @@ public override IRepository InitVBAProject(string directory)
152
152
repo . Stage ( stat . FilePath ) ;
153
153
}
154
154
155
- repo . Commit ( "Intial Commit" ) ;
155
+ try
156
+ {
157
+ //The default behavior of LibGit2Sharp.Repo.Commit is to throw an exception if no signature is found,
158
+ // but BuildSignature() does not throw if a signature is not found, it returns "unknown" instead.
159
+ // so we pass a signature that won't throw along to the commit.
160
+ repo . Commit ( "Intial Commit" , GetSignature ( ) ) ;
161
+ }
162
+ catch ( LibGit2SharpException ex )
163
+ {
164
+ throw new SourceControlException ( "Unable to perform intial commit." , ex ) ;
165
+ }
156
166
}
157
167
158
168
return repository ;
@@ -240,7 +250,10 @@ public override void Commit(string message)
240
250
{
241
251
try
242
252
{
243
- _repo . Commit ( message ) ;
253
+ //The default behavior of LibGit2Sharp.Repo.Commit is to throw an exception if no signature is found,
254
+ // but BuildSignature() does not throw if a signature is not found, it returns "unknown" instead.
255
+ // so we pass a signature that won't throw along to the commit.
256
+ _repo . Commit ( message , GetSignature ( ) ) ;
244
257
}
245
258
catch ( LibGit2SharpException ex )
246
259
{
You can’t perform that action at this time.
0 commit comments