Re: I don't want the .git directory next to my code.
- From
Linus Torvalds <torvalds@linux-foundation.org>
- Date
- Jan 17, 2008, 18:02 UTC
- Message-ID
- <alpine.LFD.1.00.0801170958550.14959@woody.linux-foundation.org>
- In-Reply-To
- <alpine.LSU.1.00.0801171748520.5731@racer.site>
On Thu, 17 Jan 2008, Johannes Schindelin wrote:
> > > Ok, here's the ugliest idea *ever*: > > Okay, you won.
"I would like to thank the Academy for giving me this honor. I couldn't have done this without my parents, my teachers in high school, and the girl next-door.."
Show 8 quoted lines
> > + attr_len = getxattr(".", "user.git-dir", git_dir, sizeof(git_dir)-1);
> > + if (attr_len > 0) {
> > + git_dir[attr_len] = 0;
> > + if (is_git_directory(git_dir)) {
> > + setenv(GIT_DIR_ENVIRONMENT, git_dir, 1);
> > + break;
>
> What's this break all about?Without the break, it will consider it a failure, and try to go up the directory structure ("..") to find the next thing.
In other words, that "break" is exactly the same break as the one just a few lines earlier:
if (is_git_directory(DEFAULT_GIT_DIR_ENVIRONMENT))
break;ie if we found a good git directory, we want to use it.
Linus