buildman: Use git worktrees instead of git clones when possible
authorAlper Nebi Yasak <alpernebiyasak@gmail.com>
Thu, 3 Sep 2020 12:51:03 +0000 (15:51 +0300)
committerSimon Glass <sjg@chromium.org>
Tue, 22 Sep 2020 18:50:43 +0000 (12:50 -0600)
commit76de29fc4f402bd23ad8cd27f7c95882913e0f6e
tree35114b512b43f87e9b36ce905060cfd18fbbce9c
parentf5bbd9a3a66eb544eb736bbf84d49e3fe227362a
buildman: Use git worktrees instead of git clones when possible

This patch makes buildman create linked working trees instead of clones
of the source repository, but keeps updating the older clones of the
repository that might already exist. These worktrees share "everything
except working directory specific files such as HEAD, index, etc." with
the source repository. See the git-worktree(1) manual page for more
information.

If git-worktree isn't available, silently falls back to cloning the
repository.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
tools/buildman/builder.py
tools/buildman/func_test.py
tools/patman/gitutil.py