You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
388 B
19 lines
388 B
2 years ago
|
#!/usr/bin/env bash
|
||
|
|
||
|
set -euo pipefail
|
||
|
|
||
|
DIRNAME="$(dirname -- "${BASH_SOURCE[0]}")"
|
||
|
PATCH="$DIRNAME/upgradeable.patch"
|
||
|
|
||
|
error() {
|
||
|
echo Error: "$*" >&2
|
||
|
exit 1
|
||
|
}
|
||
|
|
||
|
if ! git diff-files --quiet ":!$PATCH"; then
|
||
|
error "Unstaged changes. Stage to include in patch or temporarily stash."
|
||
|
fi
|
||
|
|
||
|
git diff-index --cached --patch --output="$PATCH" HEAD
|
||
|
git restore --staged --worktree ":!$PATCH"
|