Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(pre-receive): Skip validation of git-annex branches #3267

Merged
merged 1 commit into from
Jan 6, 2025
Merged
Changes from all commits
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
37 changes: 21 additions & 16 deletions services/datalad/hooks/pre-receive
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,27 @@ function main() {
continue
fi

IFS=$'\n'
for file in $large_files; do
if [[ "$status" == 0 ]]; then
echo ""
echo "-------------------------------------------------------------------------"
echo "Your push was rejected because it contains files larger than 10MB."
echo "Please use git-annex to store larger files."
echo "-------------------------------------------------------------------------"
echo ""
echo "Offending files:"
status="$EXIT_FAILURE"
fi
echo " - ${file} (ref: ${refname})"
done
unset IFS

if [[ "$branch" == "git-annex" || "$branch" == "synced/git-annex" ]]; then
continue
fi
# Additional validation and filtering of main/master branches

filterDotFiles

# Check if .bidsignore is in the new tree
Expand All @@ -147,22 +168,6 @@ END
exit $EXIT_FAILURE
fi

IFS=$'\n'
for file in $large_files; do
if [[ "$status" == 0 ]]; then
echo ""
echo "-------------------------------------------------------------------------"
echo "Your push was rejected because it contains files larger than 10MB."
echo "Please use git-annex to store larger files."
echo "-------------------------------------------------------------------------"
echo ""
echo "Offending files:"
status="$EXIT_FAILURE"
fi
echo " - ${file} (ref: ${refname})"
done
unset IFS

validateGitAttributes
done

Expand Down
Loading