@@ -366,20 +366,20 @@ func (s *GitRepo) Ping() bool {
366
366
367
367
// EscapePathSeparator escapes the path separator by replacing it with several.
368
368
// Note: this is harmless on Unix, and needed on Windows.
369
- func EscapePathSeparator (path string ) ( string ) {
369
+ func EscapePathSeparator (path string ) string {
370
370
switch runtime .GOOS {
371
371
case `windows` :
372
372
// On Windows, triple all path separators.
373
373
// Needed to escape backslash(s) preceding doublequotes,
374
374
// because of how Windows strings treats backslash+doublequote combo,
375
375
// 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.
377
377
// See: https://blogs.msdn.microsoft.com/twistylittlepassagesallalike/2011/04/23/everyone-quotes-command-line-arguments-the-wrong-way/
378
378
// e.g., C:\foo\bar\ -> C:\\\foo\\\bar\\\
379
379
// used with --prefix, like this: --prefix=C:\foo\bar\ -> --prefix=C:\\\foo\\\bar\\\
380
380
return strings .Replace (path ,
381
381
string (os .PathSeparator ),
382
- string (os .PathSeparator ) + string (os .PathSeparator ) + string (os .PathSeparator ),
382
+ string (os .PathSeparator )+ string (os .PathSeparator )+ string (os .PathSeparator ),
383
383
- 1 )
384
384
default :
385
385
return path
@@ -404,15 +404,15 @@ func (s *GitRepo) ExportDir(dir string) error {
404
404
return NewLocalError ("Unable to create directory" , err , "" )
405
405
}
406
406
407
- path = EscapePathSeparator ( dir )
407
+ path = EscapePathSeparator (dir )
408
408
out , err := s .RunFromDir ("git" , "checkout-index" , "-f" , "-a" , "--prefix=" + path )
409
409
s .log (out )
410
410
if err != nil {
411
411
return NewLocalError ("Unable to export source" , err , string (out ))
412
412
}
413
413
414
414
// and now, the horror of submodules
415
- path = EscapePathSeparator ( dir + "$path" + string (os .PathSeparator ) )
415
+ path = EscapePathSeparator (dir + "$path" + string (os .PathSeparator ))
416
416
out , err = s .RunFromDir ("git" , "submodule" , "foreach" , "--recursive" , "git checkout-index -f -a --prefix=" + path )
417
417
s .log (out )
418
418
if err != nil {
0 commit comments