X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=path.c;h=2c077c0c8f7066c5338050ce890c0846adedf6bd;hb=bf3e274873e56d7df25d60800c8d59a309e0d8c6;hp=d635470de1ad9f8a0f43e264d27f3d4c4b9b8705;hpb=0870ca7fabe6f25095431280e480859f7c66e8ab;p=git.git diff --git a/path.c b/path.c index d635470d..2c077c0c 100644 --- a/path.c +++ b/path.c @@ -131,7 +131,7 @@ int validate_symref(const char *path) return -1; } -static char *current_dir() +static char *current_dir(void) { return getcwd(pathname, sizeof(pathname)); } @@ -181,7 +181,7 @@ char *enter_repo(char *path, int strict) return NULL; if (strict) { - if((path[0] != '/') || chdir(path) < 0) + if (chdir(path) < 0) return NULL; } else { @@ -199,6 +199,7 @@ char *enter_repo(char *path, int strict) if(access("objects", X_OK) == 0 && access("refs", X_OK) == 0 && validate_symref("HEAD") == 0) { putenv("GIT_DIR=."); + check_repository_format(); return current_dir(); }