This repository has been archived by the owner on Nov 9, 2017. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The commit in #86 attempted to better handle recursive
paths that would exceed MAX_PATH on Windows, since the paths would
be too long to fit in Git's buffers when expressed relatively,
but could easily fit when reduced back to a canonical path. This
also adds a testcase that was lacking from the original commit that
attempts to describe the behavior.
Also, #111 attempted to work around a bug that
#86 introduced. This partially reverts the change,
but it keeps the concept of checking for the special device names
using string lists as a better way to detect if a path should
not be manipulated.
Finally, it is not documented clearly in the Windows API, but
GetFullPathNameW() actually may require a string longer than the
actual output length, so we use a temp buffer that is twice as
long. Windows is able to resolve the relative path, even if
the relative path is longer than 260 characters, since the
function doesn't actually check for a valid name. There is a bit
of a red herring that it is limited to MAX_PATH characters, and
while that may be true of the input string (such as, you cannot
have a relative path longer than MAX_PATH), the temporary space
needed may be longer, but the output still needs to be less than
MAX_PATH characters without using "?".
Signed-off-by: Doug Kelly [email protected]