summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 29796c6)
raw | patch | inline | side by side (parent: 29796c6)
author | Junio C Hamano <gitster@pobox.com> | |
Wed, 5 Aug 2009 05:08:16 +0000 (22:08 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 5 Aug 2009 09:21:11 +0000 (02:21 -0700) |
When comparing the index and a tree, we used to read the contents of the
tree into stage #1 of the index and compared them with stage #0. In order
not to lose sight of entries originally unmerged in the index, we hoisted
them to stage #3 before reading the tree.
Commit d1f2d7e (Make run_diff_index() use unpack_trees(), not read_tree(),
2008-01-19) changed all this. These days, we instead use unpack_trees()
API to traverse the tree and compare the contents with the index, without
modifying the index at all. There is no reason to hoist the unmerged
entries to stage #3 anymore.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
tree into stage #1 of the index and compared them with stage #0. In order
not to lose sight of entries originally unmerged in the index, we hoisted
them to stage #3 before reading the tree.
Commit d1f2d7e (Make run_diff_index() use unpack_trees(), not read_tree(),
2008-01-19) changed all this. These days, we instead use unpack_trees()
API to traverse the tree and compare the contents with the index, without
modifying the index at all. There is no reason to hoist the unmerged
entries to stage #3 anymore.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff-lib.c | patch | blob | history |
diff --git a/diff-lib.c b/diff-lib.c
index ad5b6cac7b8b6e832607f0936a417872d9ede858..2a82dac101127f09eec52afb2b78aef968f777cb 100644 (file)
--- a/diff-lib.c
+++ b/diff-lib.c
return 0;
}
-/*
- * This turns all merge entries into "stage 3". That guarantees that
- * when we read in the new tree (into "stage 1"), we won't lose sight
- * of the fact that we had unmerged entries.
- */
-static void mark_merge_entries(void)
-{
- int i;
- for (i = 0; i < active_nr; i++) {
- struct cache_entry *ce = active_cache[i];
- if (!ce_stage(ce))
- continue;
- ce->ce_flags |= CE_STAGEMASK;
- }
-}
-
/*
* This gets a mix of an existing index and a tree, one pathname entry
* at a time. The index entry may be a single stage-0 one, but it could
struct unpack_trees_options opts;
struct tree_desc t;
- mark_merge_entries();
-
ent = revs->pending.objects[0].item;
tree_name = revs->pending.objects[0].name;
tree = parse_tree_indirect(ent->sha1);