{"thread":{"id":"9380","subject":"[MinGW PATCH] 'git clone git://...' was failing inside git-read-tree with 'fatal: Not a valid object name HEAD'","startedAt":"2007-08-04T11:38:13Z","lastAt":"2007-08-04T14:16:28Z","messageCount":2,"participants":["Dmitry Kakurin","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"49697","messageId":"F7C35F51E58245FDA1EE1C2F2B4EB204@ntdev.corp.microsoft.com","threadId":"9380","inReplyTo":null,"subject":"[MinGW PATCH] 'git clone git://...' was failing inside git-read-tree with 'fatal: Not a valid object name HEAD'","fromName":"Dmitry Kakurin","fromEmail":"dmitry.kakurin@gmail.com","sentAt":"2007-08-04T11:38:13Z","receivedAt":"2007-08-04T11:38:13Z","isPatch":true,"sender":{"key":"dmitry.kakurin@gmail.com","avatar":null},"body":"NOTE: This fix uses is_absolute_path from msysGit-0.3.exe that is not in mingw.git yet.\n\nCorrectly test for absolute path\n\nThis fix (while correct) actually avoids another nasty bug that must be fixed later:\nenvironment.c caches results of many getenv calls.\nUnder MinGW setenv(X) invalidates all previous values returned by getenv(X) \nso cached values become dangling pointers.\n\nSigned-off-by: Dmitry Kakurin <Dmitry.Kakurin@gmail.com>\n---\n setup.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/setup.c b/setup.c\nindex e921013..47cd790 100644\n--- a/setup.c\n+++ b/setup.c\n@@ -332,7 +332,7 @@ const char *setup_git_directory_gently(int *nongit_ok)\n   * In case there is a work tree we may change the directory,\n   * therefore make GIT_DIR an absolute path.\n   */\n- if (gitdirenv[0] != '/') {\n+ if ( !is_absolute_path( gitdirenv ) ) {\n   setenv(GIT_DIR_ENVIRONMENT, gitdir, 1);\n   gitdirenv = getenv(GIT_DIR_ENVIRONMENT);\n   if (!gitdirenv)\n-- \nmingw.v1.5.2.4.884.gad85-dirty\n"},{"id":"49726","messageId":"Pine.LNX.4.64.0708041515251.14781@racer.site","threadId":"9380","inReplyTo":"F7C35F51E58245FDA1EE1C2F2B4EB204@ntdev.corp.microsoft.com","subject":"Re: [MinGW PATCH] 'git clone git://...' was failing inside git-read-tree with 'fatal: Not a valid object name HEAD'","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-08-04T14:16:28Z","receivedAt":"2007-08-04T14:16:28Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sat, 4 Aug 2007, Dmitry Kakurin wrote:\n\n> NOTE: This fix uses is_absolute_path from msysGit-0.3.exe that is not in\n> mingw.git yet.\n\nOoops.  I think I did not even check that into msysgit.git.  Thanks.\n\n> - if (gitdirenv[0] != '/') {\n> + if ( !is_absolute_path( gitdirenv ) ) {\n\nOur coding style does not want them extra spaces...\n\n+ if (!is_absolute_path(gitdirenv)) {\n\nis the way we prefer it.\n\nCiao,\nDscho\n"}]}