Skip to content

v1.4.3

Latest
Compare
Choose a tag to compare
@andrewmcwatters andrewmcwatters released this 20 Aug 23:31

Fixed

  • Target path calculation with git aliases: Fixed critical bug where target paths were incorrectly calculated when using git fetch-file commands from subdirectories within a repository. Git aliases that start with ! execute from the repository root, causing the tool to incorrectly detect the working directory as the repository root instead of the directory where the user invoked the command.
  • GIT_PREFIX environment variable support: Now properly uses Git's GIT_PREFIX environment variable to determine the correct relative path from repository root to where the command was invoked, ensuring target paths are calculated correctly regardless of where the git alias runs.
  • Manifest target storage accuracy: Target paths in the .git-remote-files manifest are now correctly stored relative to the git repository root, accounting for the actual directory where the command was run.

Technical Details

  • Modified get_relative_path_from_git_root() to use os.environ.get('GIT_PREFIX') instead of Path.cwd().relative_to(git_root)
  • Enhanced conflict detection logic to handle cases where the same file from the same repository is being tracked with different target paths
  • Improved target path calculation for both explicit target directories and default placement scenarios

Examples of Fixed Behavior

Before (incorrect):

cd repo/subdir
git fetch-file add https://github.com/user/repo.git file.txt myfile.txt
# Would store: target = myfile.txt (incorrect, should be subdir/myfile.txt)

After (correct):

cd repo/subdir  
git fetch-file add https://github.com/user/repo.git file.txt myfile.txt
# Now stores: target = subdir/myfile.txt (correct)

What's Changed

New Contributors

Full Changelog: v1.4.2...v1.4.3