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 <jaraco@google.com>
Reviewed-by: Mike Frysinger <vapier@google.com>
Commit-Queue: Jason R. Coombs <jaraco@google.com>
This commit is contained in:
Jason R. Coombs 2023-09-29 12:42:22 -04:00 committed by LUCI
parent 83c66ec661
commit 47944bbe2e

View File

@ -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):