Skip to content

Commit 8fa12a3

Browse files
committed
always use topmost/repo's .git as "--git-dir"
1 parent 5d7c21f commit 8fa12a3

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
#!/bin/sh
22
set -ex
33

4-
cd "$(dirname "$0")/../../$1"
4+
# use the repo root directory as "--git-dir"
5+
cd "$(dirname "$0")/../.."
6+
7+
dir="$1"
58

69
# notify git about untracked (except ignored) files
7-
git add -N .
10+
git add -N "$dir"
811

912
# display overview of changed files
10-
git status .
13+
git status "$dir"
1114

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

0 commit comments

Comments
 (0)