Skip to content

Test to show forward and backslashes in sub directories are handled c…#1387

Open
ornatwork wants to merge 6 commits intolibgit2:masterfrom
ornatwork:master
Open

Test to show forward and backslashes in sub directories are handled c…#1387
ornatwork wants to merge 6 commits intolibgit2:masterfrom
ornatwork:master

Conversation

@ornatwork
Copy link
Copy Markdown

…orrectly.

Ref
#1075

@ethomson
Copy link
Copy Markdown
Member

Hi! Thanks for the PR. However, after looking more closely at #1075, I'm not certain that the issue is correct as reported. (And if it is something that we want, then we would only want that behavior on Windows.)

This is because you can, in fact, have a file named \ in a Git repository:

erg:Temp/testrepos/test% git init .
Reinitialized existing Git repository in /Users/ethomson/Temp/testrepos/test/.git/
zoidberg:Temp/testrepos/test% touch \\
zoidberg:Temp/testrepos/test% git add \\
zoidberg:Temp/testrepos/test% git status       
On branch master

Initial commit

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)

    new file:   "\\"

zoidberg:Temp/testrepos/test% git ls-files --stage
100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0   "\\"

So on at least non-Windows platforms where \ is never a directory separator, we would want to ensure that \ was not treated as a path separator.

My inclination is to say that we never want \ as a directory separator for Git repository paths, though. Git paths are separated by /, regardless of what the platform uses for its filesystem.

@ornatwork
Copy link
Copy Markdown
Author

ornatwork commented Nov 18, 2016

You know this better than myself, should I just wrap the test to run only on windows ( which I'm leaning towards ) or do you just want to close out #1075 or something else ?

@ornatwork
Copy link
Copy Markdown
Author

ornatwork commented Nov 19, 2016

I was intending to create a new pull request with my checkin 8c9791b for issue #760 but for whatever reason it landed on this PR -- backed out below

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants