Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix "foo is outside repository" error when "git lfs track" in a symlinked dir#818

Merged
technoweenie merged 1 commit into
git-lfs:masterfrom
sinbad:fix-track-in-symlinked-dir
Nov 16, 2015
Merged

Fix "foo is outside repository" error when "git lfs track" in a symlinked dir#818
technoweenie merged 1 commit into
git-lfs:masterfrom
sinbad:fix-track-in-symlinked-dir

Conversation

@sinbad

@sinbad sinbad commented Nov 6, 2015

Copy link
Copy Markdown
Contributor

To reproduce, run this with an unmatched git lfs:

git init track-symlinkdst
ln -s track-symlinkdst track-symlinksrc
cd track-symlinksrc
git lfs track "*.png"

This was accidentally caused by the move to use git rev-parse --top-level to find the working dir. While more reliable than previous manual methods, git also silently resolves symlinks in the returned path, meaning that lfs.LocalWorkingDir is always the real path and not the symlink. This causes HasPrefix tests to fail unless you also check the resolved symlink version.

@jiangxin

jiangxin commented Nov 9, 2015

Copy link
Copy Markdown
Contributor

Today I encounter the same issue, but has slight different solutions, see #822

@technoweenie

Copy link
Copy Markdown
Contributor

Thanks for the patch!

technoweenie added a commit that referenced this pull request Nov 16, 2015
Fix "foo is outside repository" error when "git lfs track" in a symlinked dir
@technoweenie technoweenie merged commit 256e95b into git-lfs:master Nov 16, 2015
This was referenced Nov 16, 2015
@sinbad sinbad deleted the fix-track-in-symlinked-dir branch November 24, 2015 12:03
@technoweenie technoweenie mentioned this pull request Apr 11, 2016
17 tasks
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.

3 participants