Skip to content

Commit 54b5067

Browse files
authored
Merge pull request #3 from 26B/feature/add-merge-exception
2 parents ff54efd + 91b4395 commit 54b5067

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Diff for: pre-commit

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
#!/bin/sh
22

3+
# If currently in a merge don't check files.
4+
MERGE=$(git rev-parse -q --verify MERGE_HEAD)
5+
if [[ ! -z "$MERGE" ]]
6+
then
7+
# Currently in merge, let git handle the rest.
8+
exit 0
9+
fi
10+
311
# Get list of staged files excluding deleted files (lowercase d in --diff-filter).
412
FILES=$(git diff --cached --name-only --diff-filter=d | grep \\.php)
513
if [[ $(echo $FILES | wc -c) -eq "1" ]]
@@ -51,4 +59,4 @@ else
5159
echo ${GREEN}Nothing to patch.${NC}
5260
rm phpcspatch.diff
5361
exit 0
54-
fi
62+
fi

0 commit comments

Comments
 (0)