Skip to content

Commit 76ac06d

Browse files
committed
Merge branch 'mingw-expand-absolute-user-path'
When compiling Git with a runtime prefix (so that it can be installed into any location, finding its libexec/ directory relative to the location of the `git` executable), it is convenient to provide "absolute" Unix-y paths e.g. for http.sslCAInfo, and have those absolute paths be resolved relative to the runtime prefix. This patch makes it so for Windows. It is up for discussion whether we want this for other platforms, too, as long as building with RUNTIME_PREFIX. Signed-off-by: Johannes Schindelin <[email protected]>
2 parents eeeceda + 4f43be3 commit 76ac06d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

path.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "path.h"
1212
#include "packfile.h"
1313
#include "object-store.h"
14+
#include "exec-cmd.h"
1415

1516
static int get_st_mode_bits(const char *path, int *mode)
1617
{
@@ -711,6 +712,10 @@ char *expand_user_path(const char *path, int real_home)
711712

712713
if (path == NULL)
713714
goto return_null;
715+
#ifdef __MINGW32__
716+
if (path[0] == '/')
717+
return system_path(path + 1);
718+
#endif
714719
if (path[0] == '~') {
715720
const char *first_slash = strchrnul(path, '/');
716721
const char *username = path + 1;

0 commit comments

Comments
 (0)