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

Fix directory comparison in changes #140

Merged
merged 1 commit into from
Apr 26, 2019

Conversation

dmcgowan
Copy link
Member

Currently string comparison is used to detect changes. The comparisons are already done ordered, however since - will compare before /, a directory deletion which also has a directory ending with - can cause the wrong change output. The comparisons must be done considering directory separators as the lowest sorting value.

Related to moby/buildkit#960

Currently string comparison is used to detect changes.
The comparisons are already done ordered, however since
`-` will compare before `/`, a directory deletion which
also has a directory ending with `-` can cause the wrong
change output. The comparisons must be done considering
directory separators as the lowest sorting value.

Signed-off-by: Derek McGowan <[email protected]>
Copy link
Member

@fuweid fuweid left a comment

Choose a reason for hiding this comment

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

LGTM

{"/dir1/dir2你/", "/dir1/dir2/", 1},
{"/dir1/dir2你/", "/dir1/dir2你/", 0},
{"/dir1/dir2你/", "/dir1/dir2你好/", -1},
{"/dir1/dir2你/", "/dir1/dir2你-好/", -1},
Copy link
Member

Choose a reason for hiding this comment

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

@dmcgowan you should try the character biang 😄

Copy link
Member

Choose a reason for hiding this comment

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

no unicode for biang :P

@AkihiroSuda
Copy link
Member

1 maintainer LGTM and 1 reviewer LGTM. Merging.

@AkihiroSuda AkihiroSuda merged commit aaeac12 into containerd:master Apr 26, 2019
thaJeztah added a commit to thaJeztah/docker that referenced this pull request Apr 27, 2019
- containerd/continuity#140 Fix directory comparison in changes

Signed-off-by: Sebastiaan van Stijn <[email protected]>
docker-jenkins pushed a commit to docker-archive/docker-ce that referenced this pull request May 11, 2019
- containerd/continuity#140 Fix directory comparison in changes

Signed-off-by: Sebastiaan van Stijn <[email protected]>
Upstream-commit: 447cbff50a91fc66cd1893ebf3fdd8176a4d87bf
Component: engine
thaJeztah added a commit to thaJeztah/docker that referenced this pull request May 14, 2019
- containerd/continuity#140 Fix directory comparison in changes

Signed-off-by: Sebastiaan van Stijn <[email protected]>
(cherry picked from commit 447cbff)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
docker-jenkins pushed a commit to docker-archive/docker-ce that referenced this pull request May 14, 2019
- containerd/continuity#140 Fix directory comparison in changes

Signed-off-by: Sebastiaan van Stijn <[email protected]>
(cherry picked from commit 447cbff50a91fc66cd1893ebf3fdd8176a4d87bf)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Upstream-commit: 790388a8c5e5f2ae3afbff29d06b7509882505be
Component: engine
kiku-jw pushed a commit to kiku-jw/moby that referenced this pull request May 16, 2019
- containerd/continuity#140 Fix directory comparison in changes

Signed-off-by: Sebastiaan van Stijn <[email protected]>
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.

4 participants