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

Commit a2664de

Browse files
Only settiung wincred on windows
1 parent 7d44210 commit a2664de

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

src/GitHub.Api/ApplicationManagerBase.cs

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -120,22 +120,25 @@ private async Task RunInternal()
120120

121121
await RestartRepository();
122122

123-
string credentialHelper = null;
124-
var gitConfigGetTask = new GitConfigGetTask(Environment, ProcessManager,
125-
new TaskResultDispatcher<string>(s => {
126-
credentialHelper = s;
127-
}), "credential.helper", GitConfigSource.Global);
123+
if (Environment.IsWindows)
124+
{
125+
string credentialHelper = null;
126+
var gitConfigGetTask = new GitConfigGetTask(Environment, ProcessManager,
127+
new TaskResultDispatcher<string>(s => {
128+
credentialHelper = s;
129+
}), "credential.helper", GitConfigSource.Global);
128130

129131

130-
await gitConfigGetTask.RunAsync(CancellationToken.None);
132+
await gitConfigGetTask.RunAsync(CancellationToken.None);
131133

132-
if (credentialHelper != "wincred")
133-
{
134-
var gitConfigSetTask = new GitConfigSetTask(Environment, ProcessManager,
135-
new TaskResultDispatcher<string>(s => { }), "credential.helper", "wincred",
136-
GitConfigSource.Global);
134+
if (credentialHelper != "wincred")
135+
{
136+
var gitConfigSetTask = new GitConfigSetTask(Environment, ProcessManager,
137+
new TaskResultDispatcher<string>(s => { }), "credential.helper", "wincred",
138+
GitConfigSource.Global);
137139

138-
await gitConfigSetTask.RunAsync(CancellationToken.None);
140+
await gitConfigSetTask.RunAsync(CancellationToken.None);
141+
}
139142
}
140143
}
141144

0 commit comments

Comments
 (0)