summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1126b41)
raw | patch | inline | side by side (parent: 1126b41)
author | Junio C Hamano <junkio@cox.net> | |
Fri, 13 May 2005 00:16:04 +0000 (17:16 -0700) | ||
committer | Petr Baudis <xpasky@machine.sinus.cz> | |
Fri, 13 May 2005 05:30:23 +0000 (07:30 +0200) |
It is kind of surprising that this was missed in the last round,
but the work tree scanner in git-ls-files was still deliberately
ignoring symlinks. This patch fixes it, so that --others will
correctly report unregistered symlinks.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Petr Baudis <pasky@ucw.cz>
but the work tree scanner in git-ls-files was still deliberately
ignoring symlinks. This patch fixes it, so that --others will
correctly report unregistered symlinks.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Petr Baudis <pasky@ucw.cz>
cache.h | patch | blob | history | |
ls-files.c | patch | blob | history |
index ff229ee523d5228c5c1631e0c0a6b50e5ac9dcb6..c06b94107e0e1149be0ad642812e8d4a42f2193c 100644 (file)
--- a/cache.h
+++ b/cache.h
#define DT_UNKNOWN 0
#define DT_DIR 1
#define DT_REG 2
+#define DT_LNK 3
#define DTYPE(de) DT_UNKNOWN
#endif
diff --git a/ls-files.c b/ls-files.c
index a2d8cbb2f8d0090a496177cd38f252786d29c3d6..393340628ea86d6b9e5cf5d289bb6f3d4e70a1ea 100644 (file)
--- a/ls-files.c
+++ b/ls-files.c
/*
* Read a directory tree. We currently ignore anything but
- * directories and regular files. That's because git doesn't
- * handle them at all yet. Maybe that will change some day.
+ * directories, regular files and symlinks. That's because git
+ * doesn't handle them at all yet. Maybe that will change some
+ * day.
*
* Also, we currently ignore all names starting with a dot.
* That likely will not change.
case DT_UNKNOWN:
if (lstat(fullname, &st))
continue;
- if (S_ISREG(st.st_mode))
+ if (S_ISREG(st.st_mode) || S_ISLNK(st.st_mode))
break;
if (!S_ISDIR(st.st_mode))
continue;
baselen + len + 1);
continue;
case DT_REG:
+ case DT_LNK:
break;
}
add_name(fullname, baselen + len);