[WIP PATCH 05/26] enter_repo(): use setup_git_directory_gently internally

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx>
---
 path.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/path.c b/path.c
index 0005df3..6a311d7 100644
--- a/path.c
+++ b/path.c
@@ -281,6 +281,7 @@ char *enter_repo(char *path, int strict)
 {
 	static char used_path[PATH_MAX];
 	static char validated_path[PATH_MAX];
+	int nongit_ok;
 
 	if (!path)
 		return NULL;
@@ -334,12 +335,9 @@ char *enter_repo(char *path, int strict)
 	else if (chdir(path))
 		return NULL;
 
-	if (access("objects", X_OK) == 0 && access("refs", X_OK) == 0 &&
-	    validate_headref("HEAD") == 0) {
-		set_git_dir(".");
-		check_repository_format();
+	setup_git_directory_gently(&nongit_ok);
+	if (!nongit_ok)
 		return path;
-	}
 
 	return NULL;
 }
-- 
1.7.0.195.g637a2

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]