[gnome-builder] code-index: don't walk into symlinks
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] code-index: don't walk into symlinks
- Date: Thu, 25 Jan 2018 07:52:45 +0000 (UTC)
commit a15194ef159b9c65b6605a5eb64d1eb73d77fbdd
Author: Christian Hergert <chergert redhat com>
Date: Wed Jan 24 23:51:35 2018 -0800
code-index: don't walk into symlinks
We don't want to check symlinks, because they all our files we be
indexed without following them, and this just duplicates data.
Also, we could exit the project directory.
src/plugins/code-index/ide-code-index-builder.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/src/plugins/code-index/ide-code-index-builder.c b/src/plugins/code-index/ide-code-index-builder.c
index 3457fbfcf..ea4cae5e4 100644
--- a/src/plugins/code-index/ide-code-index-builder.c
+++ b/src/plugins/code-index/ide-code-index-builder.c
@@ -433,6 +433,7 @@ find_all_files_typed (GFile *root,
g_assert (func != NULL);
enumerator = g_file_enumerate_children (root,
+ G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK","
G_FILE_ATTRIBUTE_STANDARD_NAME","
G_FILE_ATTRIBUTE_STANDARD_TYPE","
G_FILE_ATTRIBUTE_TIME_MODIFIED,
@@ -469,7 +470,9 @@ find_all_files_typed (GFile *root,
func (g_steal_pointer (&fi), user_data);
}
- if (recursive && file_type == G_FILE_TYPE_DIRECTORY)
+ if (recursive &&
+ !g_file_info_get_is_symlink (info) &&
+ file_type == G_FILE_TYPE_DIRECTORY)
{
g_autoptr(GFile) child = g_file_enumerator_get_child (enumerator, info);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]