Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve issue with directory symlinks in local replace. #1829 #1830

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jtszalay
Copy link

What type of PR is this?

Uncomment one line below and remove others.

Bug fix

What package or component does this PR mostly affect?

cmd/fetch_repo

What does this PR do? Why is it needed?

Handles directory symlinks in fetch_repo.

Which issues(s) does this PR fix?

Fixes #1829

Other notes for review

if err != nil {
return err
}
linkInfo, err := os.Lstat(linkTarget)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Instead of EvalSymlinks and Lstat, could we just use Stat?

}
if linkInfo.IsDir() {
// Rather than copying the directory symlink we create the dir and continue
// This resolves an issue where the walk attempts to copy files into the symlinked directory
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is the precise problem that the walk saw the symlink as not a directory (since the FileInfo comes from an Lstat) and this tried to copy over a file to what should be a directory?

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.

go.mod FilePath ReplaceDirective fails copying folder.
2 participants