summaryrefslogtreecommitdiff
path: root/tests/path/win32.c
Commit message (Collapse)AuthorAgeFilesLines
* util: don't include unnecessary system librariesEdward Thomson2021-11-221-1/+0
| | | | Remove some unnecessary includes from utility code.
* tests: declare functions statically where appropriateEdward Thomson2021-11-111-12/+4
|
* path: bump most Win32 unicode buffer sizes from MAX_PATH to GIT_PATH_MAXIan Hattendorf2021-05-051-6/+4
|
* win32: introduce relative path handling functionEdward Thomson2020-03-101-0/+40
| | | | | | | Add a function that takes a (possibly) relative UTF-8 path and emits a UTF-16 path with forward slashes translated to backslashes. If the given path is, in fact, absolute, it will be translated to absolute path handling rules.
* win32: clarify usage of path canonicalization funcsEdward Thomson2020-03-081-10/+0
| | | | | | | | | | | The path canonicalization functions on win32 are intended to canonicalize absolute paths; those with prefixes. In other words, things start with drive letters (`C:\`), share names (`\\server\share`), or other prefixes (`\\?\`). This function removes leading `..` that occur after the prefix but before the directory/file portion (eg, turning `C:\..\..\..\foo` into `C:\foo`). This translation is not appropriate for local paths.
* Attempt at fixing the MingW64 compilationlhchavez2019-01-061-1/+1
| | | | It seems like MingW64's size_t is defined differently than in Linux.
* tests: path: only compile test_canonicalize on Win32 platformsPatrick Steinhardt2018-11-281-5/+2
| | | | | | | | The function `test_canonicalize` is only used on Win32 platforms. It will thus result in an unused function warning if these warnings are enabled and one is on a platform different than Win32. Fix the issue by only compiling in the function on Win32 platforms.
* win32: more tests for `git_win32_remove_path`Edward Thomson2018-10-191-0/+28
|
* win32: rename `git_win32__canonicalize_path`Edward Thomson2018-10-191-5/+5
| | | | | | | | | | | The internal API `git_win32__canonicalize_path` is far, far too easily confused with the internal API `git_win32_path_canonicalize`. The former removes the namespace prefix from a path (eg, given `\\?\C:\Temp\foo`, it returns `C:\Temp\foo`, and given `\\?\UNC\server\share`, it returns `\\server\share`). As such, rename it to `git_win32_path_remove_namespace`. `git_win32_path_canonicalize` remains unchanged.
* Fix comment style and update test codeGabriel DeBacker2018-10-041-4/+7
|
* Fix issue with path canonicalization for Win32 pathsGabriel DeBacker2018-09-301-0/+18
|
* win32: further cleanups for 8.3 disablingEdward Thomson2015-02-031-5/+3
|
* win32: cleanup 8.3 disabled testsEdward Thomson2015-02-031-16/+7
|
* Fix test failures when 8.3 is disabledLinquize2015-01-311-3/+17
|
* checkout: disallow bad paths on win32Edward Thomson2014-12-161-0/+24
| | | | | | | | | | | | | | | Disallow: 1. paths with trailing dot 2. paths with trailing space 3. paths with trailing colon 4. paths that are 8.3 short names of .git folders ("GIT~1") 5. paths that are reserved path names (COM1, LPT1, etc). 6. paths with reserved DOS characters (colons, asterisks, etc) These paths would (without \\?\ syntax) be elided to other paths - for example, ".git." would be written as ".git". As a result, writing these paths literally (using \\?\ syntax) makes them hard to operate with from the shell, Windows Explorer or other tools. Disallow these.
* win32: use NT-prefixed "\\?\" pathsEdward Thomson2014-12-161-0/+190
When turning UTF-8 paths into UCS-2 paths for Windows, always use the \\?\-prefixed paths. Because this bypasses the system's path canonicalization, handle the canonicalization functions ourselves. We must: 1. always use a backslash as a directory separator 2. only use a single backslash between directories 3. not rely on the system to translate "." and ".." in paths 4. remove trailing backslashes, except at the drive root (C:\)