summaryrefslogtreecommitdiff
path: root/bin/git-is-clean
blob: 2b02e2641de1f39fca60422a7c57968d9b2e8ce7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh

# find dirty working directories/staging areas/stashes

# This is to find stuff that needs to be checked in, not stuff that
# needs to be pushed (`mr status` does a good job of the latter by
# also calling `git --no-pager log --branches --not --remotes
# --simplify-by-decoration --decorate --oneline`)

set -e

status="$(git status --porcelain -- "$@")"
stashes="$(git stash list)"
if ! [ -z "$status" -a -z "$stashes" ]; then
    printf "%s\n%s\n" "$status" "$stashes"
    exit 1
fi