Skip to content

Commit

Permalink
Fix pre commit (#4990)
Browse files Browse the repository at this point in the history
* Fix pre-commit.sh script

* Fix
  • Loading branch information
Jefffrey authored Oct 25, 2023
1 parent a33d42f commit a6a512f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pre-commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# This file is git pre-commit hook.
#
# Soft link it as git hook under top dir of apache arrow git repository:
# $ ln -s ../../rust/pre-commit.sh .git/hooks/pre-commit
# $ ln -s ../../pre-commit.sh .git/hooks/pre-commit
#
# This file be run directly:
# $ ./pre-commit.sh
Expand All @@ -37,14 +37,12 @@ function BYELLOW() {
echo "\033[1;33m$@\033[0m"
}

RUST_DIR="rust"

# env GIT_DIR is set by git when run a pre-commit hook.
if [ -z "${GIT_DIR}" ]; then
GIT_DIR=$(git rev-parse --show-toplevel)
fi

cd ${GIT_DIR}/${RUST_DIR}
cd ${GIT_DIR}

NUM_CHANGES=$(git diff --cached --name-only . |
grep -e ".*/*.rs$" |
Expand Down

0 comments on commit a6a512f

Please sign in to comment.