Compare commits

...

2 Commits

Author SHA1 Message Date
052156cc43 Merge branch 'main' of https://git.b4l.co.th/B4L/b4l-project-template
Some checks failed
Auto-Sort Files / auto-sort (push) Failing after 5s
2025-08-11 11:37:06 +07:00
eff0142a22 Fix git tracking issue in file movement
- Replace mv with git mv to preserve git file tracking
- Remove unnecessary git add step since git mv automatically stages changes
- Fix issue where moved files appeared as deleted in git status
- Ensure proper git history preservation when files are reorganized
- Files will now show as moved/renamed instead of deleted/added in git log
2025-08-11 11:36:49 +07:00

View File

@@ -40,7 +40,8 @@ jobs:
# Move file if it's not already in the correct location
if [ "$src" != "$dest" ] && [ -f "$src" ]; then
echo "Moving: $src -> $dest"
mv "$src" "$dest"
# Use git mv to preserve git tracking
git mv "$src" "$dest"
return 0 # Success - file was moved
fi
return 1 # No file moved
@@ -85,7 +86,7 @@ jobs:
run: |
git config --local user.email "${{ vars.WORKER_EMAIL }}"
git config --local user.name "${{ vars.WORKER_USERNAME }}"
git add docs/datasheets/ docs/images/
# git mv already stages the changes, so no need for git add
git commit -m "Auto-sort: Move DS_ and IMG_ prefixed files to correct directories
- Moved datasheet files (DS_*) to docs/datasheets/