We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ed3cdf7 commit 2842a2aCopy full SHA for 2842a2a
1 file changed
.husky/pre-push
@@ -7,7 +7,12 @@ if command -v nvm >/dev/null 2>&1 && [ -f .nvmrc ]; then
7
nvm use 20 2>/dev/null || nvm install 20 && nvm use 20
8
fi
9
10
-changed_files=$(git diff --name-only @{upstream}...HEAD 2>/dev/null)
+if git rev-parse --abbrev-ref @{upstream} >/dev/null 2>&1; then
11
+ changed_files=$(git diff --name-only @{upstream}...HEAD)
12
+else
13
+ echo "ℹ️ No upstream branch set. Skipping pre-push checks."
14
+ exit 0
15
+fi
16
17
if [ -z "$changed_files" ]; then
18
echo "ℹ️ No outgoing changes to validate. Skipping pre-push checks."
0 commit comments