Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Conversation

@JoshuaSjoding
Copy link
Contributor

Previously go-git used filepath.Join when walking tree structures and constructing paths, but its results are platform-dependent as it will return different results on different systems. For example, it will use backslashes as a path separator on Windows. As a result the SuiteTree.TestFiles test was failing on Windows because the returned paths didn't match what was expected.

filepath.Join has been changed to path.Join, which will return consistent results for all platforms. This change makes it so that go-git will always return paths with forward-slash delimiters.

Users of the library should convert the resulting file paths into platform-compatible paths when necessary.

Previously go-git used filepath.Join when walking tree structures and constructing paths, but its results are platform-dependent as it will return different results on different systems. For example, it will use backslashes as a path separator on Windows. As a result the SuiteTree.TestFiles test was failing on Windows because the returned paths didn't match what was expected.

filepath.Join has been changed to path.Join, which will return consistent results for all platforms. This change makes it so that go-git will always return paths with forward-slash delimiters.

Users of the library should convert the resulting file paths into platform-compatible paths when necessary.
@codecov-io
Copy link

Current coverage is 58.51%

Merging #27 into master will not affect coverage as of baa7bc5

@@            master     #27   diff @@
======================================
  Files           24      24       
  Stmts         1567    1567       
  Branches       200     200       
  Methods          0       0       
======================================
  Hit            917     917       
  Partial         93      93       
  Missed         557     557       

Review entire Coverage Diff as of baa7bc5

Powered by Codecov. Updated on successful CI builds.

mcuadros added a commit that referenced this pull request Feb 16, 2016
File paths will now be consistent across platforms
@mcuadros mcuadros merged commit f353195 into src-d:master Feb 16, 2016
@JoshuaSjoding JoshuaSjoding deleted the windows-compatibility branch June 24, 2016 09:08
mcuadros added a commit that referenced this pull request Jan 31, 2017
File paths will now be consistent across platforms
gsalingu-ovhus pushed a commit to gsalingu-ovhus/go-git that referenced this pull request Mar 28, 2019
Add travis.yml file and build pass logo
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants