From 47944bbe2ea69009c0da78573f6536ad2c77f026 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 29 Sep 2023 12:42:22 -0400 Subject: [PATCH] project: Invoke realpath on dotgit for symmetry with gitdir to ensure a short relpath. Bug: 302680231 Change-Id: Icd01dd2ce62d737a4acb114e729189cd31f6bde9 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/388234 Tested-by: Jason R. Coombs Reviewed-by: Mike Frysinger Commit-Queue: Jason R. Coombs --- project.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/project.py b/project.py index 06bb693f..3acecd64 100644 --- a/project.py +++ b/project.py @@ -3394,7 +3394,8 @@ class Project(object): # Now that the dir should be empty, clear it out, and symlink it over. platform_utils.rmdir(dotgit) platform_utils.symlink( - os.path.relpath(gitdir, os.path.dirname(dotgit)), dotgit + os.path.relpath(gitdir, os.path.dirname(os.path.realpath(dotgit))), + dotgit, ) def _get_symlink_error_message(self):