зеркало из https://github.com/microsoft/git.git
strbuf_realpath(): use platform-dependent API if available
Some platforms (e.g. Windows) provide API functions to resolve paths much quicker. Let's offer a way to short-cut `strbuf_realpath()` on those platforms. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
Родитель
7363ffdaa7
Коммит
e9c76176d9
|
@ -93,6 +93,9 @@ static char *strbuf_realpath_1(struct strbuf *resolved, const char *path,
|
||||||
goto error_out;
|
goto error_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (platform_strbuf_realpath(resolved, path))
|
||||||
|
return resolved->buf;
|
||||||
|
|
||||||
strbuf_addstr(&remaining, path);
|
strbuf_addstr(&remaining, path);
|
||||||
get_root_part(resolved, &remaining);
|
get_root_part(resolved, &remaining);
|
||||||
|
|
||||||
|
|
|
@ -579,6 +579,10 @@ static inline int git_has_dir_sep(const char *path)
|
||||||
#define query_user_email() NULL
|
#define query_user_email() NULL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef platform_strbuf_realpath
|
||||||
|
#define platform_strbuf_realpath(resolved, path) NULL
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __TANDEM
|
#ifdef __TANDEM
|
||||||
#include <floss.h(floss_execl,floss_execlp,floss_execv,floss_execvp)>
|
#include <floss.h(floss_execl,floss_execlp,floss_execv,floss_execvp)>
|
||||||
#include <floss.h(floss_getpwuid)>
|
#include <floss.h(floss_getpwuid)>
|
||||||
|
|
Загрузка…
Ссылка в новой задаче