Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Really long windows dirs #38

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Really long windows dirs #38

wants to merge 2 commits into from

Conversation

TomKemperNL
Copy link
Contributor

Finally had a free hour to fix #37

@@ -291,7 +292,10 @@ class Repository
if err
reject err
if stderr?.length > 0
reject stderr
if isWindows and stderr.length > windowsMaxPathLength
resolve(stdout)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the error thrown in this case? The result still comes from the stdout? Just files with path < 260?

If I'm right, maybe we need to put a comment here specifying that the error is probably something related to a big file path.

Whats leads us to: is there anything in the error message that could specify it better than its length being greater than 260 chars?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, it ain't pretty.

The problem is that the error is just a string
/path/that/is/long could not find file or somesuch

The problem is that there is no error code or somesuch and windows error message could be localized, so I can't match the string.

Given that windows-paths can also contain spaces I'm not quite sure how to reliably recognize the situation.

The only case I could think of is deliberately trying to cause the error at startup with a well-known directory and saving 'the rest of the string'. But that sounds like a little bit too much work for such a small edge-case

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very much open to suggestions though!

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is 'could not find file' in stderr a better solution than stderr.length > 260?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that works since the error message could be localized, so if I had the dutch language pack enabled it would be 'bestand kon niet gevonden worden' or somesuch.

...there's got to be a better way though.

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.

Really long paths fail RefreshStatus on windows
2 participants