File: tree_status.sh

package info (click to toggle)
golang-github-containers-common 0.62.2%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,436 kB
  • sloc: makefile: 131; sh: 102
file content (19 lines) | stat: -rwxr-xr-x 368 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env bash
set -e

SUGGESTION="${SUGGESTION:-run \"make vendor\" and commit all changes.}"

STATUS=$(git status --porcelain)
if [[ -z $STATUS ]]
then
	echo "tree is clean"
else
	echo "tree is dirty, please $SUGGESTION"
	echo ""
	echo "$STATUS"
	echo ""
	echo "---------------------- Diff below ----------------------"
	echo ""
	git --no-pager diff
	exit 1
fi