From 4733757bb1e997493c148e2a515cc9d45b4cd099 Mon Sep 17 00:00:00 2001 From: Saugat Pachhai Date: Tue, 4 May 2021 20:44:09 +0545 Subject: [PATCH] use realpath for is_in_repo calculation (#5954) This is because, the repo root is used from a realpath, and the stage.wdir is abspath. We might need to use same kinds of path, but this patch seems to be the easiest/fastest way to fix the flaky tests (if all the tests agree). --- dvc/output/local.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dvc/output/local.py b/dvc/output/local.py index 752d8bf09..76fa01ab7 100644 --- a/dvc/output/local.py +++ b/dvc/output/local.py @@ -73,9 +73,9 @@ class LocalOutput(BaseOutput): if os.path.isabs(self.def_path): return False - if self.repo and not self.path_info.isin(self.repo.root_dir): - return False - return True + return self.repo and path_isin( + os.path.realpath(self.path_info), self.repo.root_dir + ) def dumpd(self): ret = super().dumpd()