We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0f7ab4e commit 1cd4b15Copy full SHA for 1cd4b15
bashrc/functions.sh
@@ -187,13 +187,20 @@ rspec_show_affected_files() {
187
fail_if_not_git_repo || return 1;
188
local f=0;
189
local spec_files=();
190
+ local seen_files=();
191
192
echo -n "# ";
193
git show --oneline --name-only "$@" | head -n1;
194
echo "# ";
195
196
for file in $(git show --pretty="format:" --name-only "$@" | \grep -v '^$'); do
197
if [[ "$file" == spec/* ]] && [[ "$file" == *_spec.rb ]]; then
198
+ # Skip if we've already seen this file
199
+ if [[ " ${seen_files[*]} " == *" $file "* ]]; then
200
+ continue
201
+ fi
202
+ seen_files+=("$file")
203
+
204
(( f++ ))
205
export "$GIT_ENV_CHAR"$f="$file";
206
echo -e "# \033[2;37m[\033[0m$f\033[2;37m]\033[0m $file";
0 commit comments