Commit fe6d7ffa authored by Robert Ma's avatar Robert Ma Committed by Commit Bot

[blinkpy] Set the default branch explicitly in git_unittest.py

Make the tests pass regardless of init.defaultBranch in gitconfig.

Bug: 1136164
Change-Id: I909c9e90144a621975982e3d8e32eb69fefdece9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2456407
Commit-Queue: Rakib Hasan <rmhasan@google.com>
Auto-Submit: Robert Ma <robertma@chromium.org>
Reviewed-by: default avatarRakib Hasan <rmhasan@google.com>
Cr-Commit-Position: refs/heads/master@{#815402}
parent 4a117ac3
......@@ -27,6 +27,10 @@ class GitTestWithRealFilesystemAndExecutive(unittest.TestCase):
self._run(['git', 'init', self.untracking_checkout_path])
self._chdir(self.untracking_checkout_path)
# Explicitly create the default branch instead of relying on
# init.defaultBranch. We don't use the new --initial-branch flag with
# `git init` to keep the tests compatible with older versions of git.
self._run(['git', 'checkout', '-b', 'master'])
self._set_user_config()
self._write_text_file('foo_file', 'foo')
self._run(['git', 'add', 'foo_file'])
......
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