From baa00093557d4e7e41d67ac8acfd4daccb154afd Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Mon, 22 Jan 2018 10:57:29 -0600 Subject: Support relative paths in --reference Put the correctly-expanded relative paths in objects/info/alternates. From gitrepository-layout(5), this path should be "relative to the object database, not to the repository". Change-Id: I7b2027ae23cf7d367b80f5a187603c4cbacdb2de --- subcmds/init.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'subcmds/init.py') diff --git a/subcmds/init.py b/subcmds/init.py index eeddca06..9466b9a2 100644 --- a/subcmds/init.py +++ b/subcmds/init.py @@ -401,7 +401,7 @@ to update the working directory files. git_require(MIN_GIT_VERSION, fail=True) if opt.reference: - opt.reference = os.path.abspath(os.path.expanduser(opt.reference)) + opt.reference = os.path.expanduser(opt.reference) # Check this here, else manifest will be tagged "not new" and init won't be # possible anymore without removing the .repo/manifests directory. -- cgit v1.2.3-54-g00ecf From 5f0e57d2ca28dad4e0f32849609c1857abb596fc Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Mon, 22 Jan 2018 11:00:24 -0600 Subject: init: Remove string concat in no-op os.path.join This also fixes a line length warning. Change-Id: I9c1ab65f83a35581dd657a707c7bc3c69db2b1dc --- subcmds/init.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'subcmds/init.py') diff --git a/subcmds/init.py b/subcmds/init.py index 9466b9a2..47a1c9fa 100644 --- a/subcmds/init.py +++ b/subcmds/init.py @@ -175,7 +175,8 @@ to update the working directory files. if not mirrored_manifest_git.endswith(".git"): mirrored_manifest_git += ".git" if not os.path.exists(mirrored_manifest_git): - mirrored_manifest_git = os.path.join(opt.reference + '/.repo/manifests.git') + mirrored_manifest_git = os.path.join(opt.reference, + '.repo/manifests.git') m._InitGitDir(mirror_git=mirrored_manifest_git) -- cgit v1.2.3-54-g00ecf