wfxr.forgit/tests
Wenxuan 17110bfc61
fix: preserve add paths across special filenames (#506)
Keep `forgit add` on the porcelain `git status --porcelain -zs` path so
filenames containing backslashes continue to work, while restoring the
behaviors that regressed when we moved away from Git's cwd-relative output.

This change makes the status picker emit a display label and a hidden
absolute-path payload separately. That lets the UI keep showing intuitive
cwd-relative paths, while preview, edit, and add actions operate on the real
path instead of reparsing the rendered status line. As a result, untracked
files, subdirectory workflows, and special filenames now share one consistent
path flow.

It also restores the old-Git fallback for plain `?? path` output before status
filtering, raises the required fzf version for `--accept-nth`, and adds
regression coverage for backslashes, spaces, tabs, subdirectory entries,
sibling directories, and logical symlink paths.

We explored a few alternatives before landing here. Keeping a single
human-readable line and reparsing it downstream remained too fragile for
quoted paths and backslashes. Shell-only display-path rewriting worked for
some cases but stayed brittle across logical vs physical paths and still
failed in macOS CI. A per-path `realpath` approach would have been easier to
read, but GNU-style relative-path support is not portable across the
platforms we test and would add one external process per file in a hot path.

The final tradeoff keeps the pipeline batch-oriented and portable by doing
the path normalization once in a single helper step, even though that is less
lightweight than the earlier shell-only versions. That complexity is
justified here because it fixes the old-Git untracked regression, preserves
correct preview/add behavior from subdirectories, and avoids reintroducing
long-standing filename parsing bugs.
2026-04-08 10:40:03 +08:00
..
branch-helpers.test.sh feat: add interactive git worktree operations 2026-03-10 09:20:16 +08:00
clean-select-files.test.sh Meta: update bashunit helper functions due to breaking change (#480) 2025-12-08 20:12:34 +01:00
empty-state.test.sh refactor: extract _forgit_print_dim helper and improve worktree ops 2026-03-10 09:20:16 +08:00
fzf.test.sh fix: preserve add paths across special filenames (#506) 2026-04-08 10:40:03 +08:00
helper-functions.test.sh Meta: update bashunit helper functions due to breaking change (#480) 2025-12-08 20:12:34 +01:00
is-submodule.test.sh fix: forgit add shows dir view for submodules (#484) 2025-12-21 20:45:56 +01:00
log.test.sh refactor: extract _forgit_git_log from _forgit_log 2026-03-17 17:21:28 +01:00
preview-context.test.sh fix: use non-interactive pager in fzf preview for TUI pagers (#498) 2026-03-14 10:38:44 +08:00
show.test.sh refactor: extract _forgit_git_show from _forgit_show 2026-03-17 17:21:28 +01:00
working-tree-changes.test.sh fix: preserve add paths across special filenames (#506) 2026-04-08 10:40:03 +08:00