diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2009-08-20 20:46:58 +0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-08-23 17:13:32 -0700 |
commit | b4d1690df11ae6ce382b93778616b1a20f1774ff (patch) | |
tree | 63ba6b306c569dc59c24361ebb72ac1f081b8f0e /builtin-commit.c | |
parent | 44a3691362dc71241a5d68d90b07642c46992e4a (diff) | |
download | git-b4d1690df11ae6ce382b93778616b1a20f1774ff.tar.gz |
Teach Git to respect skip-worktree bit (reading part)
grep: turn on --cached for files that is marked skip-worktree
ls-files: do not check for deleted file that is marked skip-worktree
update-index: ignore update request if it's skip-worktree, while still allows removing
diff*: skip worktree version
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-commit.c')
-rw-r--r-- | builtin-commit.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/builtin-commit.c b/builtin-commit.c index 4bcce06fbf..a0b1fd35cb 100644 --- a/builtin-commit.c +++ b/builtin-commit.c @@ -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)) |