FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

resolves #1433 TreeEntry#path should return posix path by mojavelinux · Pull Request #1434 · nodegit/nodegit · GitHub

Repository navigation

resolves #1433 TreeEntry#path should return posix path - #1434

Merged
implausible merged 1 commit into
nodegit:masterfrom
mojavelinux:issue-1433
Mar 19, 2018
Merged

implausible merged 1 commit into
nodegit:masterfrom
mojavelinux:issue-1433

Conversation

Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Contributor Author

I'm looking for someone to review this PR and provide me with some feedback.

cjhoward92 commented Mar 13, 2018 •
edited
Loading

Copy link
Copy Markdown
Contributor

I think this looks pretty good. Was there some issue you were trying to solve with this? Were you having problems? I am curios as to why this is an issue and what, if anything, could be broken by this change (it seems pretty innocuous).

Thanks for the contribution!

Copy link
Copy Markdown
Contributor

Was tree_entry.path() returning broken paths on windows? Something like C:/path/to\\file\\location?

Copy link
Copy Markdown
Contributor Author

To start, what nodegit returns differs from what the native git client (git ls-tree) returns, even on Windows. On all platforms, paths in a git repository are reported in posix form (using forward slash as the path separator).

$ git ls-tree --name-only -r HEAD
README.md
lib/README.md
lib/blame.js
...
test/tests/blame.js
...

Where this becomes a problem is when I'm building paths in the TreeWalker. On Windows, I keep having to change backslashes to forward slashes. Otherwise, when I turn around to retrieve a path from the repository, it isn't found. To me, that's where the main inconsistently comes from. If I give a path back to nodegit that nodegit gave to me, it can't find the path in the repository.

There's really no place for backslashes here. Paths in a git repository do not represent real paths (until the part of a checkout). They represent part of the object's identity. Therefore, nodegit shouldn't report different values (and thus break the object's identity) when run on different operating systems.

implausible merged commit 53e2e66 into nodegit:master Mar 19, 2018

Copy link
Copy Markdown
Contributor Author

Thanks!

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

3 participants


Back | FazBrowse Home | New Git URL