summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d9a5f25)
raw | patch | inline | side by side (parent: d9a5f25)
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | |
Sat, 20 Oct 2007 07:21:34 +0000 (08:21 +0100) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Sun, 21 Oct 2007 02:29:36 +0000 (22:29 -0400) |
There is already logic in the git wrapper to deduce the exec_path from
argv[0], when the git wrapper was called with an absolute path. Extend
that logic to handle relative paths as well.
For example, when you call "../../hello/world/git", it will not turn
"../../hello/world" into an absolute path, and use that.
Initial implementation by Scott R Parish.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
argv[0], when the git wrapper was called with an absolute path. Extend
that logic to handle relative paths as well.
For example, when you call "../../hello/world/git", it will not turn
"../../hello/world" into an absolute path, and use that.
Initial implementation by Scott R Parish.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
git.c | patch | blob | history |
index 9eaca1d67149ee60d1fe23661b6a45139987b7a2..853e66cddbbcc00943cfc0af06741ca8116b7966 100644 (file)
--- a/git.c
+++ b/git.c
/*
* Take the basename of argv[0] as the command
* name, and the dirname as the default exec_path
- * if it's an absolute path and we don't have
- * anything better.
+ * if we don't have anything better.
*/
if (slash) {
*slash++ = 0;
if (*cmd == '/')
exec_path = cmd;
+ else
+ exec_path = xstrdup(make_absolute_path(cmd));
cmd = slash;
}