mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-11 05:52:36 +02:00
update/project/*: unified git reset handling
With this change, lbmk now also updates submodules on simple git clones, not just multi-tree clones. This is OK, because git does not return non-zero status when git submodule update is ran, where git submodules are not actually defined. Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -1,6 +1,20 @@
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
# SPDX-FileCopyrightText: 2023 Leah Rowe <leah@libreboot.org>
|
||||
|
||||
git_reset_rev()
|
||||
{
|
||||
sdir="${1}"
|
||||
_rev="${2}"
|
||||
_fail="${3}"
|
||||
(
|
||||
cd "${sdir}" || "${_fail}" "cannot cd to ${sdir}"
|
||||
git reset --hard ${_rev} || \
|
||||
"${_fail}" "cannot git reset ${sdir} <- ${rev}"
|
||||
git submodule update --init --checkout || \
|
||||
"${_fail}" "cannot update git modules <- ${sdir}"
|
||||
)
|
||||
}
|
||||
|
||||
git_am_patches()
|
||||
{
|
||||
sdir="${1}" # assumed to be absolute path
|
||||
|
||||
Reference in New Issue
Block a user