Skip to content

Commit

Permalink
git-ed: uniq the list of files
Browse files Browse the repository at this point in the history
Avoid a large argument list in Vim from duplicate files when a series of
commits touches the same files multiple times. This should probably
change to use null-separated filenames for correctness; BSD sort accepts
-z, but uniq does not…
  • Loading branch information
benknoble committed Aug 7, 2024
1 parent 2ba059a commit 4ab0020
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion links/bin/git-ed
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ main() {
;;
esac
local files=()
mapfile -t files < <("$func" "$@")
mapfile -t files < <("$func" "$@" | sort | uniq)
if (( ${#files[@]} > 0 )); then
# file names are relative to repository root
cd_to_toplevel && git_editor "${files[@]}"
Expand Down

0 comments on commit 4ab0020

Please sign in to comment.