From 49cc460d88f5bae79b45ce2db16674f36b6cf38a Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Thu, 5 Aug 2010 22:39:22 -0500 Subject: Allow "check-ref-format --branch" from subdirectory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit check-ref-format --branch requires access to the repository to resolve refs like @{-1}. Noticed by Nguyễn Thái Ngọc Duy. Cc: Nguyễn Thái Ngọc Duy Signed-off-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- builtin/check-ref-format.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'builtin/check-ref-format.c') diff --git a/builtin/check-ref-format.c b/builtin/check-ref-format.c index 8707ee935a..ae3f28115a 100644 --- a/builtin/check-ref-format.c +++ b/builtin/check-ref-format.c @@ -36,7 +36,9 @@ static void collapse_slashes(char *dst, const char *src) static int check_ref_format_branch(const char *arg) { struct strbuf sb = STRBUF_INIT; + int nongit; + setup_git_directory_gently(&nongit); if (strbuf_check_branch_ref(&sb, arg)) die("'%s' is not a valid branch name", arg); printf("%s\n", sb.buf + 11); -- cgit v1.2.3