The Git working directory is used to determine the paths of the changed files, however, this could differ from the Gradle build path in some cases. Example:
git working directory = /path/to/project
Gradle build path = /path/to/project/foobar/settings.gradle
In this case, the changed files will have the foobar in the path as it is relative to the Git working directory, but Gradle uses the path relative to the build path.