aboutsummaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-08-20 23:42:18 -0700
committerJunio C Hamano <gitster@pobox.com>2008-08-20 23:42:18 -0700
commit4a871de89680842ebd43429d5d972375fb765fda (patch)
treeea1904d11cfe9169d733f57c51cfc49b5f7330a4 /dir.c
parent22c09307bf0dc9999920763d94c95086e3a55642 (diff)
parent725b06050a083474e240a2436121e0a80bb9f175 (diff)
downloadgit-4a871de89680842ebd43429d5d972375fb765fda.tar.gz
git-4a871de89680842ebd43429d5d972375fb765fda.tar.xz
Merge branch 'jc/add-stop-at-symlink'
* jc/add-stop-at-symlink: add: refuse to add working tree items beyond symlinks update-index: refuse to add working tree items beyond symlinks
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/dir.c b/dir.c
index 109e05b01..92452eb5e 100644
--- a/dir.c
+++ b/dir.c
@@ -727,8 +727,12 @@ static void free_simplify(struct path_simplify *simplify)
int read_directory(struct dir_struct *dir, const char *path, const char *base, int baselen, const char **pathspec)
{
- struct path_simplify *simplify = create_simplify(pathspec);
+ struct path_simplify *simplify;
+ if (has_symlink_leading_path(strlen(path), path))
+ return dir->nr;
+
+ simplify = create_simplify(pathspec);
read_directory_recursive(dir, path, base, baselen, 0, simplify);
free_simplify(simplify);
qsort(dir->entries, dir->nr, sizeof(struct dir_entry *), cmp_name);