Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .github/scripts/test-directory-unchanged.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
#!/bin/sh
set -ex

cd "$(dirname "$0")/../../$1"
# use the repo root directory as "--git-dir"
cd "$(dirname "$0")/../.."
Comment on lines +4 to +5
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is important as the original cd "$(dirname "$0")/../../$1" did not detected any changes in case of the checked directory was containing .git.

Example: git clone https://github.com/derickr/timelib.git ext/date/lib


dir="$1"

# notify git about untracked (except ignored) files
git add -N .
git add -N "$dir"

# display overview of changed files
git status .
git status "$dir"

# display diff of working directory vs HEAD commit and set exit code
git diff -a --exit-code HEAD .
git diff -a --exit-code HEAD "$dir"