# Make Git panel file actions work with multiple selections \(\#64640\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/651d693d4298196b6d51ef42915efb7e09377edf)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 651d693d4298196b6d51ef42915efb7e09377edf

Requested commit: 651d693d4298196b6d51ef42915efb7e09377edf

Commit: 651d693d4298196b6d51ef42915efb7e09377edf

Tree: c355bc1c68de6a603c58f496784c697b878b6d1a

Author: Zhaokang Jiang

Committer: GitHub

## Message

```
Make Git panel file actions work with multiple selections (#64640)

# Objective

Make Git panel file actions apply to the current multi-selection. View
File and several context-menu actions currently act on only the focused
row.

## Solution

- Open every selected file, file diff, and tracked file history.
- Copy selected paths as newline-separated text, preserving explicitly
selected directory paths.
- Add multiple selected untracked files to `.gitignore` or
`.git/info/exclude`.
- Show plural menu labels and avoid processing a partially staged path
twice when it appears in two sections.
- Keep single-file actions and the existing stage/discard behavior.

## Testing

- `cargo test -p git_ui --lib` — 164 passed on Windows.
- `cargo fmt --all -- --check` — passed.
- `git diff --check` — passed.
- New regression tests cover multi-file tabs, diffs, histories, path
copying, ignore/exclude writes, and duplicate status rows.


Release Notes:

- Improved Git panel file actions for multiple selected files.

---------

Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com>
```

## Parents

- [07310d0f9d7e493f883ee4b537e00631cbe404b7](https://git.cafe/gitcafe/zed/commit/07310d0f9d7e493f883ee4b537e00631cbe404b7?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/651d693d4298196b6d51ef42915efb7e09377edf?format=markdown)
