Skip to content

Evaluate symlinks in directory path names - #816

Closed
difro wants to merge 2 commits into
git-lfs:masterfrom
difro:evalsymlinks
Closed

difro wants to merge 2 commits into
git-lfs:masterfrom
difro:evalsymlinks

Conversation

@difro

@difro difro commented Nov 5, 2015

Copy link
Copy Markdown

This will normalize all directories for proper comparison.

This fixes #811

Comment thread lfs/lfs.go Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few small things:

  • There's no need to pass an error to panic. fmt.Sprintf() would be fine.
  • You can use %q instead of %s to print a quoted string.
  • "evalsymlink" in the error message should probably be split out.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was just mindlessly copy & paste'ing error-check+panic code from few lines below.
But I see your points.
Will push new commit soon.

difro added 2 commits November 6, 2015 11:11
This will normalize all directories for proper comparison.
filepath.EvalSymlinks("") outputs ".".
Fixing tests to accommodate the changed behavior.
@technoweenie

Copy link
Copy Markdown
Contributor

Thanks for the patch! Unfortunately, I went with #818 instead. It's smaller, has a shell test, and doesn't change existing git lfs env behavior.

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.

git lfs track fails when git dirpath contains symlinks

2 participants