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

[MinGW PATCH] 'git clone git://...' was failing inside git-read-tree with 'fatal: Not a valid object name HEAD'

From
DKDmitry Kakurin <dmitry.kakurin@gmail.com>
Date
Aug 4, 2007, 11:38 UTC
Message-ID
<F7C35F51E58245FDA1EE1C2F2B4EB204@ntdev.corp.microsoft.com>
NOTE: This fix uses is_absolute_path from msysGit-0.3.exe that is not in mingw.git yet.
Correctly test for absolute path

This fix (while correct) actually avoids another nasty bug that must be fixed later: environment.c caches results of many getenv calls. Under MinGW setenv(X) invalidates all previous values returned by getenv(X) so cached values become dangling pointers.

Signed-off-by: Dmitry Kakurin <Dmitry.Kakurin@gmail.com>
---
 setup.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/setup.c b/setup.c
index e921013..47cd790 100644
--- a/setup.c
+++ b/setup.c
@@ -332,7 +332,7 @@ const char *setup_git_directory_gently(int *nongit_ok)
   * In case there is a work tree we may change the directory,
   * therefore make GIT_DIR an absolute path.
   */
- if (gitdirenv[0] != '/') {
+ if ( !is_absolute_path( gitdirenv ) ) {
   setenv(GIT_DIR_ENVIRONMENT, gitdir, 1);
   gitdirenv = getenv(GIT_DIR_ENVIRONMENT);
   if (!gitdirenv)
-- 
mingw.v1.5.2.4.884.gad85-dirty
Next: Johannes Schindelin
Message 1 of 2 in “'git clone git://...' was failing inside git-read-tree with 'fatal: Not a valid object name HEAD'”
  1. 'git clone git://...' was failing inside git-read-tree with 'fatal: Not a valid object name HEAD'Dmitry Kakurin, Aug 4, 2007
  2. Johannes SchindelinAug 4, 2007

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.