threads / patch / 2375

patchAllow GIT_DIR to be an absolute path

Subject: [PATCH] Allow GIT_DIR to be an absolute path

## tl;dr

One message between Nov 6, 2005 and Nov 6, 2005. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Johannes Schindelin· Nov 6, 2005, 23:36 UTC · lore

This fixes a problem in safe_create_leading_directories() when the argument starts with a '/' (i.e. the path is absolute).

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
---
	I did not thoroughly check if there are more places where a 
	relative path is assumed. Could well be the only one.
 sha1_file.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

applies-to: 8a2743d0d424a3bc0ff120cdba66ee20b59f5a56 e1f7e03e178889c53367745810130ef3e933d2aa

Show changes to sha1_file.c +1 −1
diff --git a/sha1_file.c b/sha1_file.c
index 642f00d..544db4e 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -50,7 +50,7 @@ int get_sha1_hex(const char *hex, unsign
 
 int safe_create_leading_directories(char *path)
 {
-	char *pos = path;
+	char *pos = path+1;
 
 	while (pos) {
 		pos = strchr(pos, '/');
---
0.99.9.GIT

← back to recent threads