Skip to content

Commit fff499b

Browse files
committed
Resolve absolute file paths
1 parent b215c40 commit fff499b

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

tools/git/hooks/pre-push

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ url="$2"
4040
# Determine the current branch:
4141
export GIT_CURRENT_BRANCH=$(git name-rev --name-only HEAD)
4242

43+
# Determine root directory:
44+
root=$(git rev-parse --show-toplevel)
45+
4346

4447
# FUNCTIONS #
4548

@@ -105,7 +108,7 @@ main() {
105108
fi
106109

107110
# Get the set of changed files (added and modified):
108-
changed_files=$(git diff --name-only --diff-filter AM "${remote}/${GIT_CURRENT_BRANCH}")
111+
changed_files=$(git diff --name-only --diff-filter AM "${remote}/${GIT_CURRENT_BRANCH}" | sed -e "s#^#${root}\/#")
109112

110113
# Run JavaScript example files:
111114
files=$(echo "${changed_files}" | grep '/examples/.*\.js$' | grep -v '/examples/fixtures/.*\.js$' | tr '\n' ' ')

0 commit comments

Comments
 (0)