summaryrefslogtreecommitdiff
path: root/pre-apt.d/50uncommitted-changes
blob: c8e47367ec88cc2567a810034fbf67e35859a7d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh
set -e
if ! LANG=C git-status 2>&1 | grep -q "working directory clean"; then
	git-status || true
	echo "etckeeper warning: /etc is not clean" >&2
	printf "Press Enter to commit changes and continue. "
	read line </dev/tty
	git add .
	if ! git commit -m "saving uncommitted changes in /etc prior to apt run"; then
		echo "etckeeper warning: git commit failed" >&2
		echo "Please resolve the uncommitted changes by hand."
		printf "Press Enter when ready to continue. "
		read line </dev/tty
	fi
fi