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 <lamontjones@google.com>
Tested-by: Mateus Azis <azis@google.com>
This commit is contained in:
Mateus Azis 2022-07-21 08:13:09 -07:00
parent a8cf575d68
commit bddc964d93

View File

@ -241,7 +241,7 @@ to update the working directory files.
if current_dir != self.manifest.topdir: if current_dir != self.manifest.topdir:
print('If this is not the directory in which you want to initialize ' print('If this is not the directory in which you want to initialize '
'repo, please run:') '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.') print('and try again.')
def ValidateOptions(self, opt, args): def ValidateOptions(self, opt, args):