{"thread":{"id":"2677","subject":"[PATCH 2/4] Check repository format version in enter_repo().","startedAt":"2005-11-26T01:15:11Z","lastAt":"2005-11-26T01:15:11Z","messageCount":1,"participants":["Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"12747","messageId":"7vd5kogqg0.fsf@assigned-by-dhcp.cox.net","threadId":"2677","inReplyTo":null,"subject":"[PATCH 2/4] Check repository format version in enter_repo().","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-11-26T01:15:11Z","receivedAt":"2005-11-26T01:15:11Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"After daemon, upload-pack and receive-pack find out where the\ngit directory is and chdir() there, make sure that repository is\nin a format we understand, after putenv(\"GIT_DIR=.\") so that it\nknows to pick up the configuration file from there.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n\n---\n\n path.c |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\napplies-to: 936ce54dedc7c7cfcf8f83a742325b3329eb95a1\ned2f604235d7f400ee5fa01a591158cdabd65197\ndiff --git a/path.c b/path.c\nindex 4d88947..2c077c0 100644\n--- a/path.c\n+++ b/path.c\n@@ -199,6 +199,7 @@ char *enter_repo(char *path, int strict)\n \tif(access(\"objects\", X_OK) == 0 && access(\"refs\", X_OK) == 0 &&\n \t   validate_symref(\"HEAD\") == 0) {\n \t\tputenv(\"GIT_DIR=.\");\n+\t\tcheck_repository_format();\n \t\treturn current_dir();\n \t}\n \n---\n0.99.9.GIT\n"}]}