continue;
}
- if (stat(ce->name, &st) < 0) {
+ if (lstat(ce->name, &st) < 0) {
if (errno != ENOENT) {
perror(ce->name);
continue;
continue;
oldmode = ntohl(ce->ce_mode);
- mode = S_IFREG | ce_permissions(st.st_mode);
+ mode = (S_ISLNK(st.st_mode) ? S_IFLNK :
+ S_IFREG | ce_permissions(st.st_mode));
show_modified(oldmode, mode, ce->sha1, null_sha1,
ce->name);