Skip to content

Commit fe025c1

Browse files
authored
Merge pull request #184 from microsoft/master
Cut new release to fix deadlock with large Git configs
2 parents 85e4125 + 815e267 commit fe025c1

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

.github/workflows/build-installers.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Build-Installers
22

33
on:
44
push:
5-
branches: [ master ]
5+
branches: [ master, release ]
66
pull_request:
77
branches: [ master ]
88

src/linux/Packaging.Linux/build.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,11 @@ Section: vcs
145145
Priority: optional
146146
Architecture: $ARCH
147147
Depends:
148-
Maintainer: GCM-Core <gcmcore@microsoft.com>
149-
Description: Cross Platform Git-Credential-Manager-Core command line utility.
150-
Linux build of the GCM-Core project to support auth with a number of
151-
git hosting providers including GitHub, BitBucket, and Azure DevOps.
152-
Hosted at https://github.com/microsoft/Git-Credential-Manager-Core
148+
Maintainer: GCM-Core <gcmsupport@microsoft.com>
149+
Description: Cross Platform Git Credential Manager Core command line utility.
150+
GCM Core supports authentication with a number of Git hosting providers
151+
including GitHub, BitBucket, and Azure DevOps.
152+
For more information see https://aka.ms/gcmcore
153153
EOF
154154

155155
# Copy single binary to target installation location

src/shared/Microsoft.Git.CredentialManager/GitConfiguration.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ public void Enumerate(GitConfigurationEnumerationCallback cb)
101101
using (Process git = _git.CreateProcess($"config --null {level} --list"))
102102
{
103103
git.Start();
104+
// To avoid deadlocks, always read the output stream first and then wait
105+
// TODO: don't read in all the data at once; stream it
106+
string data = git.StandardOutput.ReadToEnd();
104107
git.WaitForExit();
105108

106109
switch (git.ExitCode)
@@ -112,9 +115,6 @@ public void Enumerate(GitConfigurationEnumerationCallback cb)
112115
$"Failed to enumerate all Git configuration entries. Exit code '{git.ExitCode}' (level={_filterLevel})");
113116
}
114117

115-
// TODO: don't read in all the data at once; stream it
116-
string data = git.StandardOutput.ReadToEnd();
117-
118118
IEnumerable<string> entries = data.Split('\0').Where(x => !string.IsNullOrWhiteSpace(x));
119119
foreach (string entry in entries)
120120
{
@@ -217,6 +217,9 @@ public IEnumerable<string> GetRegex(string nameRegex, string valueRegex)
217217
using (Process git = _git.CreateProcess($"config --null {level} --get-regex {nameRegex} {valueRegex}"))
218218
{
219219
git.Start();
220+
// To avoid deadlocks, always read the output stream first and then wait
221+
// TODO: don't read in all the data at once; stream it
222+
string data = git.StandardOutput.ReadToEnd();
220223
git.WaitForExit();
221224

222225
switch (git.ExitCode)
@@ -229,9 +232,6 @@ public IEnumerable<string> GetRegex(string nameRegex, string valueRegex)
229232
$"Failed to get Git configuration multi-valued entry '{nameRegex}' with value regex '{valueRegex}'. Exit code '{git.ExitCode}' (level={_filterLevel})");
230233
}
231234

232-
// TODO: don't read in all the data at once; stream it
233-
string data = git.StandardOutput.ReadToEnd();
234-
235235
string[] entries = data.Split('\0');
236236
foreach (string entry in entries)
237237
{

0 commit comments

Comments
 (0)