#TZ2 Failing because of clash with #LC6? Need help!

I’m stuck on Stage #TZ2

I can’t reproduce the problem locally but it looks like there’s a clash between this task and what #LC6 (directory completion) expects? There you have to complete the first directory if there’s no other completion on second TAB.

Here are my logs:

[tester::#TZ2] Running tests for Stage #TZ2 (Programmable Completion - Unregister a completion)
[tester::#TZ2] Running ./your_program.sh
[your-program] $ complete  -C  /tmp/fox/singleCompleter  git
[tester::#TZ2] ✓ Registered command-based completion
[your-program] $ complete -r git
[tester::#TZ2] ✓ No output from complete -r
[your-program] $ complete -p git
[your-program] complete: git: no completion specification
[tester::#TZ2] ✓ Found missing completion specification after unregister
[tester::#TZ2] Typed "git" followed by a <SPACE>
[tester::#TZ2] ✓ Prompt line matches "$ git "
[tester::#TZ2] Pressed "<TAB>" (expecting autocomplete to "git" followed by a space)
[your-program] $ git .codecrafters/
[tester::#TZ2] ^ Line does not match expected value.
[tester::#TZ2] Expected: "$ git "
[tester::#TZ2] Received: "$ git .codecrafters/" (no trailing space)
[tester::#TZ2] Test failed

I interpret these logs as saying that it completes the first directory after the first TAB press somehow (which I can’t reproduce). My code is using readline and just sets a custom rl_attempted_completion_function. So my assumption is that I somehow passed an earlier stage despite there being a problem.

I solved this. The problem was that I erroneously assumed that the directory completer should always only complete the first directory.