mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 10:41:31 +00:00
git-squash-branch: handle empty squashes
Error out of the current tree is dirty (previously the dirty content would be incorporated silently into the newly squashed branch!). Review URL: https://codereview.chromium.org/1064933004 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@294744 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user