Re: [PATCH] fix attribute handling in bare repositories
- From
René Scharfe <rene.scharfe@lsrfire.ath.cx>
- Date
- Jun 8, 2008, 21:31 UTC
- Message-ID
- <484C4FB2.6020105@lsrfire.ath.cx>
- In-Reply-To
- <7vskvnirjm.fsf@gitster.siamese.dyndns.org>
Junio C Hamano schrieb:
Show 14 quoted lines
> René Scharfe <rene.scharfe@lsrfire.ath.cx> writes: > >> Nguyen Thai Ngoc Duy schrieb: >>> Hi, >>> >>> Currently attr.c will read .gitattributes on disk no matter there is a >>> real worktree or not. This can lead to strange behavior. >> Yes, it probably shouldn't do that. What about this patch? > > Hmm. I do not know if it breaks anything, but if you are indeed in a bare > repository, the files the codepaths affected try to read would not exist > anyway, so I am not sure what this would fix, other than changing the > behaviour of check-attr from noticing that it was asked for nonsense and > bail out to not noticing nor saying anything useful.
The patch does two things: it fixes git-check-attr to work in a bare repository, and it makes git ignore .gitattributes files in bare repositories. True, the latter is fixable by simply not creating these files in the first place.
Duy somehow ended up with them, though, and reported it as strange that they are not ignored. And I agree: if we don't have a work tree then we should not look at it. :-)
René