-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Problem
When a dependency directory is a broken symlink (e.g., pointing to a path from a different machine), mulle-sde fetch does not remove and recreate it, leaving the project
in a broken state.
Reproduction
bash
cd /path/to/project
rm -rf dependency
ln -s /nonexistent/path dependency
mulle-sde fetch
ls -la dependency # Still a broken symlink
Root Cause
- mulle-sourcetree status --is-uptodate correctly detects the broken symlink and returns exit code 2 (DIRTY)
- However, mulle-sourcetree dbstatus only checks timestamps and returns 0 (OK)
- mulle-sde fetch prioritizes dbstatus result and decides "Nothing to do"
- The sync operation (which contains the fix for broken symlinks) is never triggered
Current Fix Status
The code in mulle-sourcetree-action.sh at line ~1647 correctly detects and removes broken symlinks:
bash
if [ -L "${previousfilename}" ]
then
if [ ! -e "${previousfilename}" ]
then
log_verbose "Removing broken symlink "${previousfilename}""
exekutor rm -f "${previousfilename}" || exit 1
fi
fi
This works when running mulle-sourcetree sync directly, but not via mulle-sde fetch.
Workaround
mulle-sde clean --tidyRun mulle-sourcetree sync directly instead of mulle-sde fetch.
Possible Solutions
- Make mulle-sde fetch respect status --is-uptodate result when it indicates broken symlinks
- Add a fast broken symlink check to dbstatus (but this may impact performance)
- Change the decision logic in mulle-sde fetch to trigger sync when status returns 2
- Do nothing (just clean --tidy)