From 987b06195e07c83c88efe1de3556c2e3e056aead Mon Sep 17 00:00:00 2001 From: "szager@chromium.org" Date: Mon, 9 Jul 2012 23:41:08 +0000 Subject: [PATCH] Set default for branch.autosetupmerge. This avoids problems with git-cl-upload picking the wrong upstream branch. Review URL: https://chromiumcodereview.appspot.com/10758011 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@145791 0039d316-1c4b-4281-b951-d872f2087c98 --- gclient_scm.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/gclient_scm.py b/gclient_scm.py index a466e3f72..d34a6506b 100644 --- a/gclient_scm.py +++ b/gclient_scm.py @@ -201,17 +201,21 @@ class GitWrapper(SCMWrapper): 'submodule.$name.ignore', 'all'] cmd = ['git', 'submodule', '--quiet', 'foreach', ' '.join(submod_cmd)] cmd2 = ['git', 'config', 'diff.ignoreSubmodules', 'all'] + cmd3 = ['git', 'config', 'branch.autosetupmerge'] + kwargs = {'cwd': self.checkout_path, + 'print_stdout': False, + 'filter_fn': lambda x: None} try: - gclient_utils.CheckCallAndFilter( - cmd, cwd=self.checkout_path, print_stdout=False, - filter_fn=lambda x: None) - gclient_utils.CheckCallAndFilter( - cmd2, cwd=self.checkout_path, print_stdout=False, - filter_fn=lambda x: None) + gclient_utils.CheckCallAndFilter(cmd, **kwargs) + gclient_utils.CheckCallAndFilter(cmd2, **kwargs) except subprocess2.CalledProcessError: # Not a fatal error, or even very interesting in a non-git-submodule # world. So just keep it quiet. pass + try: + gclient_utils.CheckCallAndFilter(cmd3, **kwargs) + except subprocess2.CalledProcessError: + gclient_utils.CheckCallAndFilter(cmd3 + ['always'], **kwargs) def update(self, options, args, file_list): """Runs git to update or transparently checkout the working copy.