From e87e22d0f22eb262a90e76197465d6cfd9707ea1 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 14 Jan 2008 13:54:24 -0800 Subject: [PATCH] Revert "builtin-commit.c: remove useless check added by faulty cut and paste" This reverts commit 16335fdd7ace78a8285ba25fd7a81177a48e7c9b. We are calling overlay_tree_on_cache() which does use CE_UPDATE flag to mark duplicated entries, which is the same as the codepath in git-ls-files with its --with-tree option. Because the pathname ce->name is given to path_list_insert() which does not allow duplicates, there is no breakage either way from the correctness point of view in this codepath, unlike the one in ls-files. But avoiding unnecessary processing with a single bit check is certainly better. --- builtin-commit.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/builtin-commit.c b/builtin-commit.c index 265ba6bcd..6d2ca808b 100644 --- a/builtin-commit.c +++ b/builtin-commit.c @@ -156,6 +156,8 @@ static int list_paths(struct path_list *list, const char *with_tree, for (i = 0; i < active_nr; i++) { struct cache_entry *ce = active_cache[i]; + if (ce->ce_flags & htons(CE_UPDATE)) + continue; if (!pathspec_match(pattern, m, ce->name, 0)) continue; path_list_insert(ce->name, list); -- 2.11.0