Commit 2da1ade7 authored by agable@chromium.org's avatar agable@chromium.org

Add --upstream flag to presubmit_support for Git.

R=hinoka@chromium.org
BUG=368720

Review URL: https://codereview.chromium.org/267513002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@267254 0039d316-1c4b-4281-b951-d872f2087c98
parent 3f802b8b
......@@ -1458,9 +1458,9 @@ def load_files(options, args):
files = scm.SVN.CaptureStatus([], options.root)
elif change_scm == 'git':
change_class = GitChange
# TODO(maruel): Get upstream.
upstream = options.upstream or None
if not files:
files = scm.GIT.CaptureStatus([], options.root, None)
files = scm.GIT.CaptureStatus([], options.root, upstream)
else:
logging.info('Doesn\'t seem under source control. Got %d files' % len(args))
if not files:
......@@ -1532,6 +1532,9 @@ def Main(argv):
"If inherit-review-settings-ok is present in this "
"directory, parent directories up to the root file "
"system directories will also be searched.")
parser.add_option("--upstream",
help="Git only: the base ref or upstream branch against "
"which the diff should be computed.")
parser.add_option("--default_presubmit")
parser.add_option("--may_prompt", action='store_true', default=False)
parser.add_option("--skip_canned", action='append', default=[],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment