Re: [PATCH] Add core.symlinks to mark filesystems that do not support symbolic links.

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

 



Junio C Hamano <junkio@xxxxxxx> writes:

> This code (I am the guilty one before your change above) always
> confused me.  How about doing something like this instead?
>
>     static inline unsigned int ce_mode_from_stat(struct cache_entry *ce,...
>     {
>         /*
>          * A regular file that appears on the filesystem can have
>          * a "wrong" st_mode information.  A few repository config
>          * variables can tell us to trust the mode recorded in the
>          * index more than what we get from the filesystem.
>          */
>         if (ce && S_ISREG(mode)) {
>             extern int trust_executable_bit, has_symlinks;
>
>             if (!has_symlinks && S_ISLNK(ntohl(ce->ce_mode)))
>                 return ce->ce_mode;

Oops, these three lines

>             if (!trust_executable_bit && S_ISREG(ntohl(ce->ce_mode)))
>                 return ce->ce_mode;
>             return create_ce_mode(0666);

should be:

		if (!trust...) {
                	if (S_ISREG(...))
                        	return ce->ce_mode;
			return create_ce_mode(0666);
		}

Still confused I am ;-(.

-
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]