diff options
Diffstat (limited to 'builtin-commit.c')
-rw-r--r-- | builtin-commit.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/builtin-commit.c b/builtin-commit.c index 256181a68b..6433f86cbb 100644 --- a/builtin-commit.c +++ b/builtin-commit.c @@ -175,9 +175,11 @@ static void add_remove_files(struct path_list *list) { int i; for (i = 0; i < list->nr; i++) { + struct stat st; struct path_list_item *p = &(list->items[i]); - if (file_exists(p->path)) - add_file_to_cache(p->path, 0); + + if (!lstat(p->path, &st)) + add_to_cache(p->path, &st, 0); else remove_file_from_cache(p->path); } |