Re: [PATCH] Do not change the file type if the filesystem does not support symlinks.
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Feb 27, 2007, 22:54 UTC
- Message-ID
- <Pine.LNX.4.63.0702272352080.22628@wbgn013.biozentrum.uni-wuerzburg.de>
- In-Reply-To
- <1172612504272-git-send-email-johannes.sixt@telecom.at>
Hi,
On Tue, 27 Feb 2007, Johannes Sixt wrote:
Show 11 quoted lines
> diff --git a/read-cache.c b/read-cache.c
> index 605b352..f09ee2e 100644
> --- a/read-cache.c
> +++ b/read-cache.c
> @@ -116,7 +116,8 @@ static int ce_match_stat_basic(struct cache_entry *ce, struct stat *st)
>
> switch (ntohl(ce->ce_mode) & S_IFMT) {
> case S_IFREG:
> - changed |= !S_ISREG(st->st_mode) ? TYPE_CHANGED : 0;
> + if (trust_symlink_fmt && !S_ISREG(st->st_mode))
> + changed |= TYPE_CHANGED;Really? If the cache entry says S_IFREG we should not expect a symlink here, right?
Show 7 quoted lines
> @@ -125,7 +126,8 @@ static int ce_match_stat_basic(struct cache_entry *ce, struct stat *st) > changed |= MODE_CHANGED; > break; > case S_IFLNK: > - changed |= !S_ISLNK(st->st_mode) ? TYPE_CHANGED : 0; > + if (trust_symlink_fmt && !S_ISLNK(st->st_mode)) > + changed |= TYPE_CHANGED;
This does not handle the case symlink->directory, right?
Ciao, Dscho