Created
December 16, 2011 15:44
-
-
Save mjdominus/1486532 to your computer and use it in GitHub Desktop.
is the working tree dirty?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is the function that git-rebase--interactive uses to determine if the | |
# working tree is clean, and to bail out if not | |
require_clean_work_tree () { | |
# test if working tree is dirty | |
git rev-parse --verify HEAD > /dev/null && | |
git update-index --ignore-submodules --refresh && | |
git diff-files --quiet --ignore-submodules && | |
git diff-index --cached --quiet HEAD --ignore-submodules -- || | |
die "Working tree is dirty" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment