Skip to content

Commit df81cd8

Browse files
authored
Merge pull request #87 from bacongobbler/fix-ci
fix ci
2 parents 6f1c6d1 + 4dafb2d commit df81cd8

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

git.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -366,20 +366,20 @@ func (s *GitRepo) Ping() bool {
366366

367367
// EscapePathSeparator escapes the path separator by replacing it with several.
368368
// Note: this is harmless on Unix, and needed on Windows.
369-
func EscapePathSeparator(path string) (string) {
369+
func EscapePathSeparator(path string) string {
370370
switch runtime.GOOS {
371371
case `windows`:
372372
// On Windows, triple all path separators.
373373
// Needed to escape backslash(s) preceding doublequotes,
374374
// because of how Windows strings treats backslash+doublequote combo,
375375
// and Go seems to be implicitly passing around a doublequoted string on Windows,
376-
// so we cannnot use default string instead.
376+
// so we cannot use default string instead.
377377
// See: https://blogs.msdn.microsoft.com/twistylittlepassagesallalike/2011/04/23/everyone-quotes-command-line-arguments-the-wrong-way/
378378
// e.g., C:\foo\bar\ -> C:\\\foo\\\bar\\\
379379
// used with --prefix, like this: --prefix=C:\foo\bar\ -> --prefix=C:\\\foo\\\bar\\\
380380
return strings.Replace(path,
381381
string(os.PathSeparator),
382-
string(os.PathSeparator) + string(os.PathSeparator) + string(os.PathSeparator),
382+
string(os.PathSeparator)+string(os.PathSeparator)+string(os.PathSeparator),
383383
-1)
384384
default:
385385
return path
@@ -404,15 +404,15 @@ func (s *GitRepo) ExportDir(dir string) error {
404404
return NewLocalError("Unable to create directory", err, "")
405405
}
406406

407-
path = EscapePathSeparator( dir )
407+
path = EscapePathSeparator(dir)
408408
out, err := s.RunFromDir("git", "checkout-index", "-f", "-a", "--prefix="+path)
409409
s.log(out)
410410
if err != nil {
411411
return NewLocalError("Unable to export source", err, string(out))
412412
}
413413

414414
// and now, the horror of submodules
415-
path = EscapePathSeparator( dir + "$path" + string(os.PathSeparator) )
415+
path = EscapePathSeparator(dir + "$path" + string(os.PathSeparator))
416416
out, err = s.RunFromDir("git", "submodule", "foreach", "--recursive", "git checkout-index -f -a --prefix="+path)
417417
s.log(out)
418418
if err != nil {

git_test.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,6 @@ func TestGitSubmoduleHandling2(t *testing.T) {
559559
t.Errorf("Current failed to detect Git on tip of master. Got version: %s", v)
560560
}
561561

562-
563562
tempDir2, err := ioutil.TempDir("", "go-vcs-git-tests-export")
564563
if err != nil {
565564
t.Fatalf("Error creating temp directory: %s", err)
@@ -583,7 +582,7 @@ func TestGitSubmoduleHandling2(t *testing.T) {
583582
t.Errorf("Error checking exported file in Git: %s", err)
584583
}
585584

586-
_, err = os.Stat(filepath.Join( filepath.Join(exportDir, "definitions"), "README.md"))
585+
_, err = os.Stat(filepath.Join(filepath.Join(exportDir, "definitions"), "README.md"))
587586
if err != nil {
588587
t.Errorf("Error checking exported file in Git: %s", err)
589588
}

vcs_remote_lookup_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ func TestVCSLookup(t *testing.T) {
3434
"https://example.com/foo/bar/baz.hg": {work: true, t: Hg},
3535
"https://gopkg.in/tomb.v1": {work: true, t: Git},
3636
"https://golang.org/x/net": {work: true, t: Git},
37-
"https://speter.net/go/exp/math/dec/inf": {work: true, t: Git},
3837
"https://git.openstack.org/foo/bar": {work: true, t: Git},
3938
"[email protected]:Masterminds/vcs.git": {work: true, t: Git},
4039
"[email protected]:foo.git": {work: true, t: Git},

0 commit comments

Comments
 (0)