I believe the two functions below is the same. But AI keep telling me they are different (that I think AI is wrong).
get_changed_files() {
local staged_files committed_files
staged_files=$(git diff --cached --name-only)
committed_files=$(git diff --name-only "$1"..HEAD)
# Combine and deduplicate files
printf "%s\n%s\n" "$staged_files" "$committed_files" | sort -u | grep -v '^$'
}
get_changed_files() {
git diff --name-only "$1" --cached
}
To be safe, I'm checking here, to see if I miss anything.
staged_filesand/orcommitted_files(first function), but not in the comparison between the index and$1(second function) ?