Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit 2520504

Browse files
Using a key for get operations
1 parent e275ec6 commit 2520504

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/GitHub.Api/Git/GitClient.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ ITask<string> Unlock(string file, bool force,
8787

8888
class GitClient : IGitClient
8989
{
90+
private const string UserNameConfigKey = "user.name";
91+
private const string UserEmailConfigKey = "user.email";
9092
private readonly IEnvironment environment;
9193
private readonly IProcessManager processManager;
9294
private readonly ITaskManager taskManager;
@@ -260,19 +262,19 @@ public ITask<User> GetConfigUserAndEmail()
260262
string username = null;
261263
string email = null;
262264

263-
return GetConfig("user.name", GitConfigSource.User).Then((success, value) => {
265+
return GetConfig(UserNameConfigKey, GitConfigSource.User).Then((success, value) => {
264266
if (success)
265267
{
266268
username = value;
267269
}
268270

269-
}).Then(GetConfig("user.email", GitConfigSource.User).Then((success, value) => {
271+
}).Then(GetConfig(UserEmailConfigKey, GitConfigSource.User).Then((success, value) => {
270272
if (success)
271273
{
272274
email = value;
273275
}
274276
})).Then(success => {
275-
Logger.Trace("user.name:{1} user.email:{2}", success, username, email);
277+
Logger.Trace("{0}:{1} {2}:{3}", UserNameConfigKey, username, UserEmailConfigKey, email);
276278
return new User { Name= username, Email = email };
277279
});
278280
}

0 commit comments

Comments
 (0)