Chromium Code Reviews| Index: git_cl.py |
| diff --git a/git_cl.py b/git_cl.py |
| index aba28f6746c3e40a95a1e674156f8ce3982c02c1..9859f4ebf841142f56208ab3f370ea11e6a23a4a 100755 |
| --- a/git_cl.py |
| +++ b/git_cl.py |
| @@ -1238,6 +1238,8 @@ def CMDupload(parser, args): |
| help='reviewer email addresses') |
| parser.add_option('--cc', |
| help='cc email addresses') |
| + parser.add_option('--allow-dirty', action='store_true', |
| + help='Allow upload even when there are uncommited changes') |
|
Sam Clegg
2013/01/10 19:48:29
I would have preferred to use --force here for thi
|
| parser.add_option('--send-mail', action='store_true', |
| help='send email to reviewer immediately') |
| parser.add_option("--emulate_svn_auto_props", action="store_true", |
| @@ -1262,7 +1264,7 @@ def CMDupload(parser, args): |
| 'In the near future, -m or --message will send a message instead.\n' |
| 'See http://goo.gl/JGg0Z for details.\n') |
| - if is_dirty_git_tree('upload'): |
| + if not options.allow_dirty and is_dirty_git_tree('upload'): |
| return 1 |
| cl = Changelist() |
| @@ -1273,6 +1275,8 @@ def CMDupload(parser, args): |
| # Default to diffing against common ancestor of upstream branch |
| base_branch = RunGit(['merge-base', cl.GetUpstreamBranch(), 'HEAD']).strip() |
| args = [base_branch] |
| + if options.allow_dirty: |
| + args.append('HEAD') |
|
Sam Clegg
2013/01/10 19:48:29
We most likely should just add 'HEAD' in all cases
|
| if not options.bypass_hooks: |
| hook_results = cl.RunHook(committing=False, upstream_branch=base_branch, |