Fix: Address submodule update issues 48/70648/1 v0.81.1
authorSangwook Ha <sangwook.ha@verizon.com>
Thu, 15 Sep 2022 01:12:12 +0000 (18:12 -0700)
committerSangwook Ha <sangwook.ha@verizon.com>
Thu, 15 Sep 2022 01:12:12 +0000 (18:12 -0700)
There are two issues affecting the autorelease-update-submodules jobs:

- git-review tries to copy commit-msg hook to submodules with incorrect
  source file path (.git/hooks/commit-msg) and fails - the path should
  be ../.git/hooks/commit-msg if a relative path is used since the copy
  command is run in the submodule directory

- lf-activate-venv creates a virtual environment in the current working
  directory where lf-activate-venv is run. This clutters the repository
  and all the files for the virtual environment are added for update.

To address the bug of git-review set 'core.hooksPath' with the absolute
path of the top-level hooks directory so that the correct source path
can be used regardless of the working directory.

The reason why a virtual environment is created in the working directory
is because the following command

  $python -m venv "$install_args" "$lf_venv"

is not equivalent to

  $python -m venv "$lf_venv"

even when $install_args is empty.

Hence the first command creates two virtual environments, one in the
current working directory and another one in $lf_venv.

Use the correct command depending on the $install_args value to avoid
the issue.

Signed-off-by: Sangwook Ha <sangwook.ha@verizon.com>
Change-Id: I445d010c5f5b9e3576bdafb0335ada1092de9d0c


No differences found