A couple of Go tests failure on Windows, fix code or tests to make them green:
--- FAIL: TestSaveAlwaysReportOption (0.15 seconds)
panic: remove C:\Users\IEUser\AppData\Local\Temp\test-repo999546479\test.git: Th
e process cannot access the file because it is being used by another process. [r
ecovered]
panic: remove C:\Users\IEUser\AppData\Local\Temp\test-repo999546479\test
.git: The process cannot access the file because it is being used by another pro
cess.
--- FAIL: TestRunnerCallCommands (0.00 seconds)
assert.go:15: V:/src/github.com/github/hub/commands/runner_test.go:42
assert.go:24: ! 0 != 1
--- FAIL: TestEditor_openAndEdit_deleteFileWhenOpeningEditorFails (0.00 seconds)
assert.go:15: V:/src/github.com/github/hub/github/editor_test.go:34
assert.go:36: ! Failure
--- FAIL: TestGitHubRepo_OriginRemote (0.16 seconds)
assert.go:15: V:/src/github.com/github/hub/github/localrepo_test.go:18
assert.go:24: ! "V:\\src\\github.com\\github\\hub\\fixtures\\test.git" !
= "ssh://V/%5Csrc%5Cgithub.com%5Cgithub%5Chub%5Cfixtures%5Ctest.git"
ssh.github.com is a hack for people on limited networks to be able to use SSH through HTTPS port. We should ignore replacing it when constructing URLs.
As part of the fix, refactor into SSHConfig and SSHConfigReader to make code testable. It also fixes a bug on `hostReStr` that doesn’t match the “Hostname” string in ssh config.
Issue: https://github.com/github/hub/issues/672
This allows someone to have something like this in their SSH config:
Host gh
HostName github.com
And then use git remote URLs such as:
gh:myname/myrepo.git
Since git itself allows people to do this, we need to support it in hub.