git-merge: Exit with code 2 if no strategy was able to handle the merge.
[git.git] / path.c
diff --git a/path.c b/path.c
index d635470..2c077c0 100644 (file)
--- 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();
        }