Teach Git to respect skip-worktree bit (reading part)
[gitweb.git] / builtin-commit.c
index 4bcce06fbffdf10ec701dfbc0b6b90a11513f89e..a0b1fd35cbacafd5afb79d3aa7a0e38e28960e8f 100644 (file)
@@ -180,6 +180,11 @@ static void add_remove_files(struct string_list *list)
        for (i = 0; i < list->nr; i++) {
                struct stat st;
                struct string_list_item *p = &(list->items[i]);
+               int pos = index_name_pos(&the_index, p->string, strlen(p->string));
+               struct cache_entry *ce = pos < 0 ? NULL : active_cache[pos];
+
+               if (ce && ce_skip_worktree(ce))
+                       continue;
 
                if (!lstat(p->string, &st)) {
                        if (add_to_cache(p->string, &st, 0))