Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2sharp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaaman <romain.magny@gmail.com>2013-04-15 18:29:22 +0400
committerSaaman <romain.magny@gmail.com>2013-04-25 12:30:58 +0400
commit4d92ed4e054e85146df31a950e053bd30a745b52 (patch)
treeec6391158e164c2919a1e03f9764140cecc12329 /LibGit2Sharp/Configuration.cs
parent902ed7d3b5b9d3ffb315a60bf4558974ded7070d (diff)
Move BuildSignatureFromGlobalConfiguration() to Configuration
Diffstat (limited to 'LibGit2Sharp/Configuration.cs')
-rw-r--r--LibGit2Sharp/Configuration.cs13
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);
+ }
}
}