Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Symlinks are checked out as regular files. #358

Closed
jmalloc opened this issue Apr 24, 2017 · 3 comments
Closed

Symlinks are checked out as regular files. #358

jmalloc opened this issue Apr 24, 2017 · 3 comments
Labels

Comments

@jmalloc
Copy link

jmalloc commented Apr 24, 2017

When attempting to clone a repository containing symlinks, the links are created as regular files directly from the object blobs - i.e, the file contents is the symlink target.

I started an attempt to implement the correct behaviour in Worktree.checkoutEntry() but it looks like the filesystem abstraction does not support symlink creation.

The following snippet clones a repo that demonstrates the issue.

package main

import (
	"fmt"
	"os"
	"path"

	git "gopkg.in/src-d/go-git.v4"
)

func main() {
	dir := path.Join(os.TempDir(), "symlink-test")
	fmt.Println(dir)

	_, err := git.PlainClone(
		dir,
		false, // bare
		&git.CloneOptions{
			URL:      "[email protected]:recoilphp/dev.git",
			Progress: os.Stdout,
		},
	)

	if err != nil {
		panic(err)
	}
}
@smola
Copy link
Collaborator

smola commented Apr 26, 2017

@jmalloc Thanks for reporting this. We first have to figure out how do we want symlinks to be handled by billy, then fixing this should be easy.

@jmalloc
Copy link
Author

jmalloc commented Apr 26, 2017

👍 I'm happy to contribute towards this with some guidance. I expect the os based implementation will be straight forward, but I wasn't sure how to tackle the memory implementation.

@smola
Copy link
Collaborator

smola commented May 16, 2017

EDIT: See src-d/go-billy#28 (comment)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants