utils: update-kernel-headers: Support git worktrees

When operating on a git worktree, the Linux kernel directory contains a
.git file, not a .git directory. Relax the git tree check to support
both.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
Laurent Pinchart 2023-09-26 02:10:15 +03:00
parent d848d2a21c
commit d2094a0185

View file

@ -18,7 +18,7 @@ if [ "$line" != "# Kbuild for top-level directory of the kernel" ] ; then
exit 1 exit 1
fi fi
if [ ! -d "${kernel_dir}/.git" ] ; then if [ ! -e "${kernel_dir}/.git" ] ; then
echo "Directory ${kernel_dir} doesn't contain a git tree" echo "Directory ${kernel_dir} doesn't contain a git tree"
exit 1 exit 1
fi fi