Skip to content

Commit d4c8ecc

Browse files
CopilotByron
andcommitted
Fixed commit filtering logic but traversal still stops early - need to debug parent processing
Co-authored-by: Byron <[email protected]>
1 parent c2a3118 commit d4c8ecc

File tree

2 files changed

+12
-27
lines changed

2 files changed

+12
-27
lines changed

gix-traverse/src/commit/simple.rs

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -524,16 +524,10 @@ mod init {
524524
}
525525
match commit_state {
526526
commit_st if commit_st.is_interesting() => {
527-
// In single-parent mode with hidden tips, only return commits on the first-parent line
527+
// In single-parent mode, only return commits on the first-parent line
528528
let should_return = if matches!(self.parents, crate::commit::Parents::First) {
529-
// In single-parent mode
530-
if state.candidates.is_none() {
531-
// No hidden tips - return all interesting commits (original behavior)
532-
true
533-
} else {
534-
// Hidden tips present - only return commits on first-parent line
535-
commit_st.is_on_first_parent_line()
536-
}
529+
// In single-parent mode - only return commits on first-parent line
530+
commit_st.is_on_first_parent_line()
537531
} else {
538532
// Not in single-parent mode - return all interesting commits
539533
true
@@ -666,16 +660,10 @@ mod init {
666660
}
667661
match commit_state {
668662
commit_st if commit_st.is_interesting() => {
669-
// In single-parent mode with hidden tips, only return commits on the first-parent line
663+
// In single-parent mode, only return commits on the first-parent line
670664
let should_return = if matches!(self.parents, crate::commit::Parents::First) {
671-
// In single-parent mode
672-
if state.candidates.is_none() {
673-
// No hidden tips - return all interesting commits (original behavior)
674-
true
675-
} else {
676-
// Hidden tips present - only return commits on first-parent line
677-
commit_st.is_on_first_parent_line()
678-
}
665+
// In single-parent mode - only return commits on first-parent line
666+
commit_st.is_on_first_parent_line()
679667
} else {
680668
// Not in single-parent mode - return all interesting commits
681669
true

gix-traverse/tests/traverse/commit/simple.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -271,11 +271,11 @@ mod hide {
271271
}
272272

273273
#[test]
274-
fn debug_single_parent_with_hidden_tips() -> crate::Result {
275-
// Simplified test to debug the issue
274+
fn single_parent_with_hidden_tips_simple() -> crate::Result {
275+
// Test simple single-parent mode first (should work)
276276
let mut assertion = TraversalAssertion::new_at(
277277
"make_repos.sh",
278-
"simple",
278+
"simple",
279279
&["f49838d84281c3988eeadd988d97dd358c9f9dc4"], /* merge */
280280
&[
281281
"0edb95c0c0d9933d88f532ec08fcd405d0eee882", /* c5 */
@@ -286,15 +286,12 @@ mod hide {
286286
],
287287
);
288288

289-
// First test normal mode to make sure it works
290-
assertion.check()?;
291-
292-
// Then test single-parent mode without hidden tips - should also work
289+
// Test single-parent mode without hidden tips - should work
293290
assertion.with_parents(Parents::First).check()?;
294291

295-
// Finally test with a single hidden tip - this is where the bug should manifest
292+
// Test single-parent mode WITH hidden tips - this should also work now
296293
assertion
297-
.with_hidden(&["48e8dac19508f4238f06c8de2b10301ce64a641c"]) /* b2c2 - just one hidden */
294+
.with_hidden(&["48e8dac19508f4238f06c8de2b10301ce64a641c"]) /* b2c2 - one hidden */
298295
.with_parents(Parents::First)
299296
.check()?;
300297

0 commit comments

Comments
 (0)