If the script parses the result from git status --porcelain It can tell if any files are staged and added etc.