Skip to content

Conversation

@ian-h-chamberlain
Copy link

What does this PR do?

Support relative paths in the yadm repo's core.worktree.

What issues does this PR fix or reference?

Relates to #414

I ran into an issue when trying to reference the git dir across filesystem boundaries (for example, in WSL). An absolute worktree directory results in "invalid" file paths (i.e. nonexistent) when Windows reads the Linux absolute path, or vice versa.

I realize this is a pretty niche behavior but the change to make it work is fairly small, so I thought I'd submit a PR.

Previous Behavior

YADM_WORK is set to the value of core.worktree directly.

New Behavior

If it does not begin with /, the value of core.worktree is resolved to an absolute path relative to GIT_DIR.

This allows for a worktree path like ../../../.. which works across multiple platforms, allowing e.g. a Windows Git-bash clien to set a WSL yadm repo as a remote.

Have tests been written for this change?

Yes

Have these commits been signed with GnuPG?

Yes


Please review yadm's Contributing Guide for best practices.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant