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