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

Commit 38ca462

Browse files
StanleyGoldmanshana
authored andcommitted
Removing an assortment of commented code
1 parent 1d6101c commit 38ca462

25 files changed

+9
-278
lines changed

src/GitHub.Api/Authentication/Keychain.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,6 @@ class ConnectionCacheItem
1818
public string Username { get; set; }
1919
}
2020

21-
/// <summary>
22-
/// {
23-
/// connections: [
24-
/// connection: { host: "github.com", user: "shana" },
25-
/// connection: { host: "server.com", user: "auser" },
26-
/// ]
27-
/// }
28-
/// </summary>
2921
class Keychain : IKeychain
3022
{
3123
const string ConnectionFile = "connections.json";

src/GitHub.Api/Installer/ZipHelper.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -118,18 +118,6 @@ public static void ExtractZipFile(string archive, string outFolder, Cancellation
118118
{
119119
Directory.CreateDirectory(directoryName);
120120
}
121-
//#if !WINDOWS
122-
// if (Environment.OSVersion.Platform == PlatformID.Unix || Environment.OSVersion.Platform == PlatformID.MacOSX)
123-
// {
124-
// if (zipEntry.ExternalFileAttributes > 0)
125-
// {
126-
// int fd = Mono.Unix.Native.Syscall.open(fullZipToPath,
127-
// Mono.Unix.Native.OpenFlags.O_CREAT | Mono.Unix.Native.OpenFlags.O_TRUNC,
128-
// (Mono.Unix.Native.FilePermissions)zipEntry.ExternalFileAttributes);
129-
// Mono.Unix.Native.Syscall.close(fd);
130-
// }
131-
// }
132-
//#endif
133121

134122
// Unzip file in buffered chunks. This is just as fast as unpacking to a buffer the full size
135123
// of the file, but does not waste memory.

src/GitHub.Api/OutputProcessors/BranchListOutputProcessor.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ public override void LineReceived(string line)
3636
trackingName = proc.ReadChunk('[', ']');
3737
}
3838

39-
//logger.Debug("Branch Name:\"{0}\" TrackedAs:\"{1}\" Active:{2}", name, tracking ? trackingName : "[None]", active);
40-
4139
var branch = new GitBranch(name, trackingName, active);
4240

4341
RaiseOnEntry(branch);

src/GitHub.Api/OutputProcessors/LogEntryOutputProcessor.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ public override void LineReceived(string line)
6262
return;
6363
}
6464
sb.AppendLine(line);
65-
//Logger.Debug(@"Phase {0} - LineReceived: ""{1}""", phase, line == null ? "null" : line);
6665

6766
if (phase == ProcessingPhase.Files && seenBodyEnd)
6867
{
@@ -311,8 +310,6 @@ private void HandleUnexpected(string line)
311310

312311
private void ReturnGitLogEntry()
313312
{
314-
//Logger.Debug("ReturnGitLogEntry commitId:" + commitId);
315-
316313
PopNewlines();
317314

318315
var description = string.Join(Environment.NewLine, descriptionLines.ToArray());

src/GitHub.Api/OutputProcessors/ProcessManager.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ public T Configure<T>(T processTask, string executableFileName, string arguments
3535
{
3636
Guard.ArgumentNotNull(executableFileName, nameof(executableFileName));
3737

38-
//logger.Trace("Configuring process - \"" + executableFileName + " " + arguments + "\" cwd:" + workingDirectory);
3938
var startInfo = new ProcessStartInfo
4039
{
4140
RedirectStandardInput = withInput,

src/GitHub.Api/OutputProcessors/StatusOutputProcessor.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,6 @@ class StatusOutputProcessor : BaseOutputProcessor<GitStatus?>
1313
private readonly IGitObjectFactory gitObjectFactory;
1414
GitStatus gitStatus;
1515

16-
//private int ahead;
17-
//private int behind;
18-
//private List<GitStatusEntry> entries;
19-
//private string localBranch;
20-
//private string remoteBranch;
21-
2216
public StatusOutputProcessor(IGitObjectFactory gitObjectFactory)
2317
{
2418
Guard.ArgumentNotNull(gitObjectFactory, "gitObjectFactory");

src/GitHub.Api/Platform/ProcessEnvironment.cs

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ public void Configure(ProcessStartInfo psi, NPath workingDirectory)
6161

6262
//TODO: Remove with Git LFS Locking becomes standard
6363
psi.EnvironmentVariables["GITLFSLOCKSENABLED"] = "1";
64-
//psi.EnvironmentVariables["GIT_TRACE"] = "1";
6564

6665
string path;
6766
var baseExecPath = gitPathRoot;
@@ -91,50 +90,18 @@ public void Configure(ProcessStartInfo psi, NPath workingDirectory)
9190
}
9291
psi.EnvironmentVariables["GIT_EXEC_PATH"] = execPath.ToString();
9392

94-
//Logger.Trace("EnvironmentVariables[\"PATH\"]=\"{0}\"", path);
95-
9693
psi.EnvironmentVariables["PATH"] = path;
9794

98-
//psi.EnvironmentVariables["github_shell"] = "true";
99-
//psi.EnvironmentVariables["git_install_root"] = gitPath; // todo: remove in favor of github_git
100-
//psi.EnvironmentVariables["github_git"] = gitPath;
10195
psi.EnvironmentVariables["PLINK_PROTOCOL"] = "ssh";
10296
psi.EnvironmentVariables["TERM"] = "msys";
10397

104-
//psi.EnvironmentVariables["EDITOR"] = Environment.GetEnvironmentVariable("EDITOR");
105-
10698
var httpProxy = Environment.GetEnvironmentVariable("HTTP_PROXY");
10799
if (!String.IsNullOrEmpty(httpProxy))
108100
psi.EnvironmentVariables["HTTP_PROXY"] = httpProxy;
101+
109102
var httpsProxy = Environment.GetEnvironmentVariable("HTTPS_PROXY");
110103
if (!String.IsNullOrEmpty(httpsProxy))
111104
psi.EnvironmentVariables["HTTPS_PROXY"] = httpsProxy;
112-
113-
//foreach (string k in psi.EnvironmentVariables.Keys)
114-
//{
115-
// Logger.Debug("{0}={1}", k, psi.EnvironmentVariables[k]);
116-
//}
117-
118-
//var existingSshAgentProcess = sshAgentBridge.GetRunningSshAgentInfo();
119-
//if (existingSshAgentProcess != null)
120-
//{
121-
// psi.EnvironmentVariables["SSH_AGENT_PID"] = existingSshAgentProcess.ProcessId;
122-
// psi.EnvironmentVariables["SSH_AUTH_SOCK"] = existingSshAgentProcess.AuthSocket;
123-
//}
124-
125-
var internalUseOnly = false;
126-
if (internalUseOnly)
127-
{
128-
psi.EnvironmentVariables["GIT_PAGER"] = "cat";
129-
psi.EnvironmentVariables["LC_ALL"] = "C";
130-
psi.EnvironmentVariables["GIT_ASKPASS"] = "true";
131-
psi.EnvironmentVariables["DISPLAY"] = "localhost:1";
132-
psi.EnvironmentVariables["SSH_ASKPASS"] = "true";
133-
psi.EnvironmentVariables["GIT_SSH"] = "ssh-noprompt";
134-
135-
psi.StandardOutputEncoding = Encoding.UTF8;
136-
psi.StandardErrorEncoding = Encoding.UTF8;
137-
}
138105
}
139106
}
140107
}

src/GitHub.Api/Primitives/HostAddress.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,13 @@ private HostAddress(Uri enterpriseUri)
4343
{
4444
WebUri = new Uri(enterpriseUri, new Uri("/", UriKind.Relative));
4545
ApiUri = new Uri(enterpriseUri, new Uri("/api/v3/", UriKind.Relative));
46-
//CredentialCacheKeyHost = ApiUri.Host;
4746
CredentialCacheKeyHost = WebUri.ToString();
4847
}
4948

5049
public HostAddress()
5150
{
5251
WebUri = new Uri("https://github.com");
5352
ApiUri = new Uri("https://api.github.com");
54-
//CredentialCacheKeyHost = "github.com";
5553
CredentialCacheKeyHost = WebUri.ToString();
5654
}
5755

src/GitHub.Api/Primitives/UriString.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ namespace GitHub.Unity
2222
[Serializable]
2323
public class UriString : StringEquivalent<UriString>, IEquatable<UriString>
2424
{
25-
//static readonly NLog.Logger log = NLog.LogManager.GetCurrentClassLogger();
2625
static readonly Regex sshRegex = new Regex(@"^.+@(?<host>(\[.*?\]|[a-z0-9-.]+?))(:(?<owner>.*?))?(/(?<repo>.*)(\.git)?)?$", RegexOptions.Compiled | RegexOptions.IgnoreCase);
2726
readonly Uri url;
2827

src/GitHub.Api/Repository.cs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -105,15 +105,12 @@ public ITask ReleaseLock(string file, bool force)
105105

106106
private void RepositoryManager_OnRemoteOrTrackingChanged()
107107
{
108-
//if (String.IsNullOrEmpty(CloneUrl))
109-
//{
110-
var remote = repositoryManager.Config.GetRemotes()
111-
.Where(x => HostAddress.Create(new UriString(x.Url).ToRepositoryUri()).IsGitHubDotCom())
112-
.FirstOrDefault();
113-
if (remote.Url != null)
114-
CloneUrl = new UriString(remote.Url).ToRepositoryUrl();
115-
//repositoryManager.OnRemoteOrTrackingChanged -= RepositoryManager_OnRemoteOrTrackingChanged;
116-
//}
108+
var remote = repositoryManager.Config.GetRemotes()
109+
.Where(x => HostAddress.Create(new UriString(x.Url).ToRepositoryUri()).IsGitHubDotCom())
110+
.FirstOrDefault();
111+
112+
if (remote.Url != null)
113+
CloneUrl = new UriString(remote.Url).ToRepositoryUrl();
117114
}
118115

119116
private void RepositoryManager_OnHeadChanged()

0 commit comments

Comments
 (0)