Subject: [PATCH 17/18] var: use RUN_SETUP_GENTLY

From: Nguyễn Thái Ngọc Duy <[email-masked]>
Date: Sun, 7 Mar 2010 11:56:06 +0700

"git var" needs to read repository config, so setup gitdir first.

Signed-off-by: Nguyễn Thái Ngọc Duy <[email-masked]>
---
 builtin/var.c |    2 --
 git.c         |    2 +-
 2 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/builtin/var.c b/builtin/var.c
index 70fdb4d..26324ef 100644
--- a/builtin/var.c
+++ b/builtin/var.c
@@ -75,12 +75,10 @@ static int show_config(const char *var, const char *value, void *cb)
 int cmd_var(int argc, const char **argv, const char *prefix)
 {
 	const char *val;
-	int nongit;
 	if (argc != 2) {
 		usage(var_usage);
 	}
 
-	setup_git_directory_gently(&nongit);
 	val = NULL;
 
 	if (strcmp(argv[1], "-l") == 0) {
diff --git a/git.c b/git.c
index e0c8904..3292627 100644
--- a/git.c
+++ b/git.c
@@ -391,7 +391,7 @@ static void handle_internal_command(int argc, const char **argv)
 		{ "update-ref", cmd_update_ref, RUN_SETUP },
 		{ "update-server-info", cmd_update_server_info, RUN_SETUP },
 		{ "upload-archive", cmd_upload_archive },
-		{ "var", cmd_var },
+		{ "var", cmd_var, RUN_SETUP_GENTLY },
 		{ "verify-tag", cmd_verify_tag, RUN_SETUP },
 		{ "version", cmd_version },
 		{ "whatchanged", cmd_whatchanged, RUN_SETUP | USE_PAGER },
-- 
1.7.0.195.g637a2