Skip to content

Commit 966c6ed

Browse files
Johannes Sixtgitster
authored andcommitted
Fix relative built-in paths to be relative to the command invocation
$(gitexecdir) (as defined in the Makefile) has gained another path component, but the relative paths in the MINGW section of the Makefile, which are interpreted relative to it, do not account for it. Instead of adding another ../ in front of the path, we change the code that constructs the absolute paths to do it relative to the command's directory, which is essentially $(bindir). We do it this way because we will also allow a relative $(gitexecdir) later. Signed-off-by: Johannes Sixt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e1464ca commit 966c6ed

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1315,7 +1315,7 @@ remove-dashes:
13151315
### Installation rules
13161316

13171317
ifeq ($(firstword $(subst /, ,$(template_dir))),..)
1318-
template_instdir = $(gitexecdir)/$(template_dir)
1318+
template_instdir = $(bindir)/$(template_dir)
13191319
else
13201320
template_instdir = $(template_dir)
13211321
endif

exec_cmd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ static const char *builtin_exec_path(void)
4343

4444
const char *system_path(const char *path)
4545
{
46-
if (!is_absolute_path(path)) {
46+
if (!is_absolute_path(path) && argv0_path) {
4747
struct strbuf d = STRBUF_INIT;
48-
strbuf_addf(&d, "%s/%s", git_exec_path(), path);
48+
strbuf_addf(&d, "%s/%s", argv0_path, path);
4949
path = strbuf_detach(&d, NULL);
5050
}
5151
return path;

0 commit comments

Comments
 (0)