From bddc964d9340c66066590a81d21934362fb0c490 Mon Sep 17 00:00:00 2001 From: Mateus Azis Date: Thu, 21 Jul 2022 08:13:09 -0700 Subject: [PATCH] Fix the printed path of the ".repo" dir after a fresh init. Apparently, manifest.topdir already contains a trailing slash in some cases, so a simple string concatenation may or not lead to double slashes. It is safer to use os.path.join. See https://screenshot.googleplex.com/6pSY3QewAeCdAqk Change-Id: I2411452296b7e78fc975787b675273a48d6b3d85 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/341574 Reviewed-by: LaMont Jones Tested-by: Mateus Azis --- subcmds/init.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subcmds/init.py b/subcmds/init.py index cced44d..e4df6b3 100644 --- a/subcmds/init.py +++ b/subcmds/init.py @@ -241,7 +241,7 @@ to update the working directory files. if current_dir != self.manifest.topdir: print('If this is not the directory in which you want to initialize ' 'repo, please run:') - print(' rm -r %s/.repo' % self.manifest.topdir) + print(' rm -r %s' % os.path.join(self.manifest.topdir, '.repo')) print('and try again.') def ValidateOptions(self, opt, args):