Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1368)

Unified Diff: git_squash_branch.py

Issue 1064933004: git-squash-branch: handle empty squashes and dirty trees (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « git_common.py ('k') | testing_support/git_test_utils.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « git_common.py ('k') | testing_support/git_test_utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698