git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Allow GIT_DIR to be an absolute path

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Nov 6, 2005, 23:36 UTC
Message-ID
<Pine.LNX.4.63.0511070034160.23992@wbgn013.biozentrum.uni-wuerzburg.de>

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

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
Message 1 of 1 in “Allow GIT_DIR to be an absolute path”
  1. Allow GIT_DIR to be an absolute pathJohannes Schindelin, Nov 6, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.