diff options
author | Saaman <romain.magny@gmail.com> | 2013-04-15 18:29:22 +0400 |
---|---|---|
committer | Saaman <romain.magny@gmail.com> | 2013-04-25 12:30:58 +0400 |
commit | 4d92ed4e054e85146df31a950e053bd30a745b52 (patch) | |
tree | ec6391158e164c2919a1e03f9764140cecc12329 /LibGit2Sharp/Configuration.cs | |
parent | 902ed7d3b5b9d3ffb315a60bf4558974ded7070d (diff) |
Move BuildSignatureFromGlobalConfiguration() to Configuration
Diffstat (limited to 'LibGit2Sharp/Configuration.cs')
-rw-r--r-- | LibGit2Sharp/Configuration.cs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/LibGit2Sharp/Configuration.cs b/LibGit2Sharp/Configuration.cs index eb273390..1942ec8c 100644 --- a/LibGit2Sharp/Configuration.cs +++ b/LibGit2Sharp/Configuration.cs @@ -287,5 +287,18 @@ namespace LibGit2Sharp (ConfigurationLevel)entry.level); }); } + + internal Signature BuildSignatureFromGlobalConfiguration(DateTimeOffset now) + { + var name = Get<string>("user.name"); + var email = Get<string>("user.email"); + + if ((name == null) || (email == null)) + { + throw new LibGit2SharpException("Can not find Name and Email settings of the current user in Git configuration."); + } + + return new Signature(name.Value, email.Value, now); + } } } |