File tree Expand file tree Collapse file tree 3 files changed +40
-2
lines changed Expand file tree Collapse file tree 3 files changed +40
-2
lines changed Original file line number Diff line number Diff line change 12
12
13
13
# Unconfigure (as the current user)
14
14
echo " Unconfiguring credential helper..."
15
- sudo -u ` /usr/bin/logname` " $GCMBIN " unconfigure
15
+ sudo -u ` /usr/bin/logname` -E " $GCMBIN " unconfigure
16
16
17
17
# Remove symlink
18
18
if [ -L /usr/local/bin/git-credential-manager-core ]
Original file line number Diff line number Diff line change @@ -107,7 +107,7 @@ public CommandContext(string appPath)
107
107
FileSystem = new MacOSFileSystem ( ) ;
108
108
SessionManager = new MacOSSessionManager ( ) ;
109
109
SystemPrompts = new MacOSSystemPrompts ( ) ;
110
- Environment = new PosixEnvironment ( FileSystem ) ;
110
+ Environment = new MacOSEnvironment ( FileSystem ) ;
111
111
Terminal = new MacOSTerminal ( Trace ) ;
112
112
string gitPath = GetGitPath ( Environment , FileSystem , Trace ) ;
113
113
Git = new GitProcess (
Original file line number Diff line number Diff line change
1
+ using System ;
2
+ using System . Collections . Generic ;
3
+ using System . Diagnostics ;
4
+ using System . IO ;
5
+ using System . Threading ;
6
+ using GitCredentialManager . Interop . Posix ;
7
+
8
+ namespace GitCredentialManager . Interop . MacOS
9
+ {
10
+ public class MacOSEnvironment : PosixEnvironment
11
+ {
12
+ private ICollection < string > _pathsToIgnore ;
13
+
14
+ public MacOSEnvironment ( IFileSystem fileSystem )
15
+ : base ( fileSystem ) { }
16
+
17
+ internal MacOSEnvironment ( IFileSystem fileSystem , IReadOnlyDictionary < string , string > variables )
18
+ : base ( fileSystem )
19
+ {
20
+ EnsureArgument . NotNull ( variables , nameof ( variables ) ) ;
21
+ Variables = variables ;
22
+ }
23
+
24
+ public override bool TryLocateExecutable ( string program , out string path )
25
+ {
26
+ if ( _pathsToIgnore is null )
27
+ {
28
+ _pathsToIgnore = new List < string > ( ) ;
29
+ if ( Variables . TryGetValue ( "HOMEBREW_PREFIX" , out string homebrewPrefix ) )
30
+ {
31
+ string homebrewGit = Path . Combine ( homebrewPrefix , "Homebrew/Library/Homebrew/shims/shared/git" ) ;
32
+ _pathsToIgnore . Add ( homebrewGit ) ;
33
+ }
34
+ }
35
+ return TryLocateExecutable ( program , _pathsToIgnore , out path ) ;
36
+ }
37
+ }
38
+ }
You can’t perform that action at this time.
0 commit comments