Re: I don't want the .git directory next to my code.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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.."

> > +		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
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux