[PATCH] upload-pack: Initialize the exec-path.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Johannes Sixt <johannes.sixt@xxxxxxxxxx>

Since git-upload-pack has to spawn git-pack-objects, it has to make sure
that the latter can be found in the PATH. Without this patch an attempt
to clone or pull via ssh from a server fails if the git tools are not in
the standard PATH on the server even though git clone or git pull were
invoked with --upload-pack=/path/to/git-upload-pack.

Signed-off-by: Johannes Sixt <johannes.sixt@xxxxxxxxxx>
---
Johannes Schindelin schrieb:
> Hi,
> 
> On Tue, 12 Feb 2008, Johannes Sixt wrote:
>> The problem is that git-upload-pack (which is not a built-in) does not
>> call setup_path() and so does not extend PATH to contain the special
>> installation location. Now, when git-upload-pack tries to exec
>> git-pack-objects, it fails since this is not in PATH.
> 
> So, let's make git-upload-pack a builtin, no?

How about this (almost) one-liner instead?

-- Hannes

 upload-pack.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/upload-pack.c b/upload-pack.c
index 7e04311..51e3ec4 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -620,6 +620,9 @@ int main(int argc, char **argv)

 	if (i != argc-1)
 		usage(upload_pack_usage);
+
+	setup_path(NULL);
+
 	dir = argv[i];

 	if (!enter_repo(dir, strict))
-- 
1.5.4.rc3.24.g25a9a

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux