Thread (12 messages) 12 messages, 2 authors, 1d ago
WARM1d

[PATCH 1/2] diff-lib: drop stale comment about advancing o->pos

From: Jeff King <hidden>
Date: 2026-07-26 08:46:24
Subsystem: the rest · Maintainer: Linus Torvalds

The comment above oneway_diff() claims that the callback must advance
o->pos to skip index entries it has already processed. That stopped
being true in da165f470e (unpack-trees.c: prepare for looking ahead in
the index, 2010-01-07), which moved that bookkeeping into
unpack_trees().

Signed-off-by: Jeff King <redacted>
---
 diff-lib.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/diff-lib.c b/diff-lib.c
index a23119b852..95f920a9a0 100644
--- a/diff-lib.c
+++ b/diff-lib.c
@@ -508,11 +508,9 @@ static void do_oneway_diff(struct unpack_trees_options *o,
  * For diffing, the index is more important, and we only have a
  * single tree.
  *
- * We're supposed to advance o->pos to skip what we have already processed.
- *
  * This wrapper makes it all more readable, and takes care of all
  * the fairly complex unpack_trees() semantic requirements, including
- * the skipping, the path matching, the type conflict cases etc.
+ * the path matching, the type conflict cases etc.
  */
 static int oneway_diff(const struct cache_entry * const *src,
 		       struct unpack_trees_options *o)
-- 
2.55.0.742.gf2bff09aa6
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help