File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 44
55# If the push refs start with (delete), then we're deleting a branch, so skip the pre-push hook
66# Source: <https://github.com/typicode/husky/issues/169#issuecomment-1719263454>
7- stdin=$( cat -)
7+ stdin=" $( cat -) "
88if echo " $stdin " | grep -q " ^(delete)" ; then
99 exit 0
1010fi
1111
12- raw_files_to_check=" $( git diff main...HEAD --name-only --diff-filter=d) "
12+ current_branch_name=" $( git branch --show-current) "
13+
14+ if [[ " $current_branch_name " == " main" ]]; then
15+ raw_files_to_check=" $( git diff origin/main...HEAD --name-only --diff-filter=d) "
16+ else
17+ raw_files_to_check=" $( git diff main...HEAD --name-only --diff-filter=d) "
18+ fi
19+
1320if [[ -n " $raw_files_to_check " ]]; then
1421 echo " *** Checking for lint violations in changed files ***************"
1522 echo
You can’t perform that action at this time.
0 commit comments