[PATCH] Do not ignore hidden refs

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Junio C Hamano <junkio@...>
Cc: <git@...>
Date: Saturday, November 18, 2006 - 12:11 am

Some of the ref manipulation tools (git-for-each-ref and git-show-ref in
particular) would not handle hidden (~ /^\./) refs. This may be an
acceptable or possibly even desirable behaviour for the ref walkers and
repackers, but git-show-ref hiddenrefname must work.

This makes Git not ignore hidden refs at all. I'm not opposed to making
some particular parts of the ref interface to continue to ignore hidden
refs, but the restriction cannot be so deep.

Signed-off-by: Petr Baudis <pasky@suse.cz>
---

 refs.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/refs.c b/refs.c
index f003a0b..06fa5c2 100644
--- a/refs.c
+++ b/refs.c
@@ -141,7 +141,8 @@ static struct ref_list *get_ref_dir(cons
 			int flag;
 			int namelen;
 
-			if (de->d_name[0] == '.')
+			if (de->d_name[0] == '.' && (de->d_name[1] == '\0'
+			    || (de->d_name[1] == '.' && de->d_name[2] == '\0')))
 				continue;
 			namelen = strlen(de->d_name);
 			if (namelen > 255)
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] Do not ignore hidden refs, Petr Baudis, (Sat Nov 18, 12:11 am)
Re: [PATCH] Do not ignore hidden refs, Linus Torvalds, (Sat Nov 18, 1:35 pm)
Re: [PATCH] Do not ignore hidden refs, Junio C Hamano, (Sat Nov 18, 2:35 pm)
Re: [PATCH] Do not ignore hidden refs, Junio C Hamano, (Sat Nov 18, 12:39 am)
Re: [PATCH] Do not ignore hidden refs, Petr Baudis, (Sat Nov 18, 12:53 am)
Re: [PATCH] Do not ignore hidden refs, Junio C Hamano, (Sat Nov 18, 3:27 am)
Re: [PATCH] Do not ignore hidden refs, Petr Baudis, (Sat Nov 18, 3:28 pm)
Re: [PATCH] Do not ignore hidden refs, Junio C Hamano, (Sat Nov 18, 3:50 pm)
Re: [PATCH] Do not ignore hidden refs, Junio C Hamano, (Sat Nov 18, 4:05 pm)
Re: [PATCH] Do not ignore hidden refs, Petr Baudis, (Sat Nov 18, 7:18 pm)
Re: [PATCH] Do not ignore hidden refs, Junio C Hamano, (Sat Nov 18, 8:29 pm)
Re: [PATCH] Do not ignore hidden refs, Petr Baudis, (Sat Nov 18, 8:48 pm)
Re: [PATCH] Do not ignore hidden refs, Petr Baudis, (Sat Nov 18, 3:55 pm)
Re: [PATCH] Do not ignore hidden refs, Shawn Pearce, (Sat Nov 18, 3:41 am)