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

utils: merkletrie, filesystem fix symlinks to dir #640

Merged
merged 2 commits into from
Nov 20, 2017

Conversation

dimonomid
Copy link
Contributor

I tried to figure how to write a proper test, but failed in a reasonable time frame, so sending the PR without a test. Nevertheless, here is a tiny repository which reproduces an issue: https://github.com/dimonomid/git-go-symlink-test/blob/master/test_symlink_dir.go

It uses another repository as a test case: https://github.com/dimonomid/git-go-fixture-dir-symlink , which has just two commits; the second one adds this tree:

.
├── dir2
│   └── file2
└── dir3
    └── dir2_symlink -> ../dir2

And to reproduce the issue, we can just clone the repo (so that we have these dir2/file2 and symlink to it), and then checkout the previous revision. This is the list of changes it tries to apply:

<Delete dir2/file2>
<Delete dir3/dir2_symlink>
<Delete dir3/dir2_symlink/file2>

And obviously the last one fails, because dir2/file2 was already removed before. This PR prevents non-dir items from having children.

@mcuadros
Copy link
Contributor

Make sense, but we need a test for merge this.

@src-d src-d deleted a comment from codecov bot Nov 20, 2017
@mcuadros mcuadros changed the title Fix support for dir symlinks utils: merkletrie, filesystem fix symlinks to dir Nov 20, 2017
@mcuadros mcuadros merged commit dcec851 into src-d:master Nov 20, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants