{"thread":{"id":"13507","subject":"[PATCH 1/2] chdir after computing new cwd in check_repository_format_gently","startedAt":"2008-05-14T05:45:21Z","lastAt":"2008-05-14T08:02:12Z","messageCount":2,"participants":["David Reiss","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"76916","messageId":"482A7C71.6050509@facebook.com","threadId":"13507","inReplyTo":null,"subject":"[PATCH 1/2] chdir after computing new cwd in check_repository_format_gently","fromName":"David Reiss","fromEmail":"dreiss@facebook.com","sentAt":"2008-05-14T05:45:21Z","receivedAt":"2008-05-14T05:45:21Z","isPatch":true,"sender":{"key":"dreiss@facebook.com","avatar":null},"body":"In preparation for adding a check before the chdir.\nThis should be a no-op because the cwd is not read in the interim\nand any nonlocal exits either chdir to an absolute path or die.\n\nSigned-off-by: David Reiss <dreiss@facebook.com>\n---\nI sent this in a few weeks ago, but got no response.  Probably because I\nmessed up the formatting.  Hopefully I'm getting it right this time.\n\n setup.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/setup.c b/setup.c\nindex b8fd476..c54f2b6 100644\n--- a/setup.c\n+++ b/setup.c\n@@ -443,7 +443,6 @@ const char *setup_git_directory_gently(int *nongit_ok)\n \t\t\tcheck_repository_format_gently(nongit_ok);\n \t\t\treturn NULL;\n \t\t}\n-\t\tchdir(\"..\");\n \t\tdo {\n \t\t\tif (!offset) {\n \t\t\t\tif (nongit_ok) {\n@@ -455,6 +454,7 @@ const char *setup_git_directory_gently(int *nongit_ok)\n \t\t\t\tdie(\"Not a git repository\");\n \t\t\t}\n \t\t} while (cwd[--offset] != '/');\n+\t\tchdir(\"..\");\n \t}\n \n \tinside_git_dir = 0;\n-- \n1.5.4\n"},{"id":"76927","messageId":"alpine.DEB.1.00.0805140901420.30431@racer","threadId":"13507","inReplyTo":"482A7C71.6050509@facebook.com","subject":"Re: [PATCH 1/2] chdir after computing new cwd in check_repository_format_gently","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-05-14T08:02:12Z","receivedAt":"2008-05-14T08:02:12Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 13 May 2008, David Reiss wrote:\n\n> In preparation for adding a check before the chdir. This should be a \n> no-op because the cwd is not read in the interim and any nonlocal exits \n> either chdir to an absolute path or die.\n\nI think it would be clearer if you squashed that commit into the other \none.\n\nCiao,\nDscho\n"}]}