Skip to content

Commit

Permalink
Cleanup script
Browse files Browse the repository at this point in the history
  • Loading branch information
MDrakos committed Nov 6, 2024
1 parent 416aa32 commit 7ff9681
Showing 1 changed file with 4 additions and 19 deletions.
23 changes: 4 additions & 19 deletions activestate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -391,24 +391,14 @@ scripts:
value: |
set -e
if git rev-parse --is-shallow-repository; then
if [ "$(git rev-parse --is-shallow-repository)" = "true" ]; then
echo "Detected shallow clone, fetching complete history..."
git fetch --unshallow origin master || {
echo "Failed to unshallow repository"
exit 1
}
git fetch --unshallow origin master
fi
git fetch origin master:refs/remotes/origin/master || {
echo "Failed to fetch master branch"
exit 1
}
git fetch origin master:refs/remotes/origin/master
MERGE_BASE=$(git merge-base HEAD origin/master) || {
echo "Error: Could not find merge base with origin/master"
exit 1
}
MERGE_BASE=$(git merge-base HEAD origin/master)
CHANGED=$(git diff --name-only $MERGE_BASE...HEAD | grep -v testdata | grep -v vendor) || true
if [ -z "$CHANGED" ]; then
echo "No relevant changed files found"
Expand All @@ -418,19 +408,14 @@ scripts:
NO_NEWLINE=0
for FILE in $CHANGED; do
echo "Checking file: $FILE"
if [ ! -f "$FILE" ]; then
echo "Warning: File no longer exists: $FILE"
continue
fi
if file "$FILE" | grep -q -E 'text|ASCII'; then
echo "File is text: $FILE"
if [ $(tail -c 1 "$FILE" | wc -l) -eq 0 ]; then
echo "Missing newline at end of file: $FILE"
NO_NEWLINE=1
fi
else
echo "Skipping non-text file: $FILE"
fi
done
- name: grab-mergecommits
Expand Down

0 comments on commit 7ff9681

Please sign in to comment.