Index: git_squash_branch.py |
diff --git a/git_squash_branch.py b/git_squash_branch.py |
index 83acfa7f033d48fdbac8d145c1b8022d6c312c69..33366d28b90098e59f459a8e59fc1b851f0bdebf 100755 |
--- a/git_squash_branch.py |
+++ b/git_squash_branch.py |
@@ -6,7 +6,7 @@ |
import argparse |
import sys |
-from git_common import squash_current_branch |
+import git_common |
def main(args): |
parser = argparse.ArgumentParser() |
@@ -14,7 +14,9 @@ def main(args): |
'-m', '--message', metavar='<msg>', default='git squash commit.', |
help='Use the given <msg> as the first line of the commit message.') |
opts = parser.parse_args(args) |
- squash_current_branch(opts.message) |
+ if git_common.is_dirty_git_tree('squash-branch'): |
+ return 1 |
+ git_common.squash_current_branch(opts.message) |
return 0 |