Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
expand_user_path(): support specifying paths relative to the runtime …
…prefix Ever since Git learned to detect its install location at runtime, there was the slightly awkward problem that it was impossible to specify paths relative to said location. For example, if a version of Git was shipped with custom SSL certificates to use, there was no portable way to specify `http.sslCAInfo`. In Git for Windows, the problem was "solved" for years by interpreting paths starting with a slash as relative to the runtime prefix. However, this is not correct: such paths _are_ legal on Windows, and they are interpreted as absolute paths in the same drive as the current directory. After a lengthy discussion, and a way lengthier time to mull over the problem and its best solution, we decided to introduce support for the magic sequence `<RUNTIME-PREFIX>/`. If a path starts with this, the remainder is interpreted as relative to the detected runtime prefix. This solves the problem, but what new problems does it stir up? Here are the two most obvious ones: - What if Git was not compiled with support for a runtime prefix? In that case, we will simply use the compiled-in hard-coded prefix. - What if a user _wants_ to specify a path starting with the magic sequence? In that case, the user will simply need to prefix the magic sequence with `./` and voilà, the path won't be expanded. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
- Loading branch information