2021-12-14 21:51:17 +03:00
|
|
|
# Create and maintain a minimal git repo at the root of the copied src
|
|
|
|
(
|
2022-08-16 22:00:00 +03:00
|
|
|
# shellcheck disable=SC2154,SC2164
|
2021-12-14 21:51:17 +03:00
|
|
|
cd "$scriptDir/.."
|
2022-09-02 16:12:06 +03:00
|
|
|
amend=(--amend)
|
2022-08-16 22:00:00 +03:00
|
|
|
|
2022-08-28 18:52:47 +03:00
|
|
|
if [[ ! -e .git ]] || ! git rev-parse HEAD 2>/dev/null; then
|
2021-12-14 21:51:17 +03:00
|
|
|
git init
|
2022-09-02 16:12:06 +03:00
|
|
|
amend=()
|
2021-12-14 21:51:17 +03:00
|
|
|
fi
|
|
|
|
git add .
|
|
|
|
if ! git diff --quiet --cached; then
|
2022-09-02 16:12:06 +03:00
|
|
|
git commit -a "${amend[@]}" -m -
|
2021-12-14 21:51:17 +03:00
|
|
|
fi
|
|
|
|
) >/dev/null
|