diff options
author | Steffen Prohaska <prohaska@zib.de> | 2008-07-13 22:31:18 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-07-13 14:41:28 -0700 |
commit | 2de9de5e4ae1353f1552f61cf8cf532e3f1dc5f6 (patch) | |
tree | aa862fe50c73cb0f8cff6b717423388ca3cffc5c /exec_cmd.h | |
parent | a9a3e82e6d0018ff42ec11fd9560c1ff47add824 (diff) | |
download | git-2de9de5e4ae1353f1552f61cf8cf532e3f1dc5f6.tar.gz |
Move code interpreting path relative to exec-dir to new function system_path()
Expanding system paths relative to git_exec_path can be used for
creating an installation that can be moved to a different directory
without re-compiling. We use this approach for template_dir and the
system wide gitconfig. The Windows installer (msysgit) is an example
for such a setup.
This commit moves common code to a new function system_path(). System
paths that are to be interpreted relative to git_exec_path are passed to
system_path() and the return value is used instead of the original path.
system_path() prefixes a relative path with git_exec_path and leaves
absolute paths unmodified. For example, we now write
template_dir = system_path(DEFAULT_GIT_TEMPLATE_DIR);
[j6t: moved from path.c to exec_cmd.c]
Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'exec_cmd.h')
-rw-r--r-- | exec_cmd.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/exec_cmd.h b/exec_cmd.h index a892355c82..7eb94e5e11 100644 --- a/exec_cmd.h +++ b/exec_cmd.h @@ -6,6 +6,6 @@ extern const char* git_exec_path(void); extern void setup_path(const char *); extern int execv_git_cmd(const char **argv); /* NULL terminated */ extern int execl_git_cmd(const char *cmd, ...); - +extern const char *system_path(const char *path); #endif /* GIT_EXEC_CMD_H */ |