Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Unified Diff: testing_support/git_test_utils.py

Issue 184113002: Add git-map and git-short-map to depot_tools. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@new_branch
Patch Set: Make it work on windows Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « git_number.py ('k') | tests/git_common_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: testing_support/git_test_utils.py
diff --git a/testing_support/git_test_utils.py b/testing_support/git_test_utils.py
index bf583c684db142a6b3ced9b9c1b4b3b049f15cac..5becad94ba58e0ece7bbcbdaa812fee034d1d0d9 100644
--- a/testing_support/git_test_utils.py
+++ b/testing_support/git_test_utils.py
@@ -256,6 +256,7 @@ class GitRepo(object):
self.git('init')
for commit in schema.walk():
self._add_schema_commit(commit, schema.data_for(commit.name))
+ self.last_commit = self[commit.name]
if schema.master:
self.git('update-ref', 'master', self[schema.master])
@@ -321,7 +322,7 @@ class GitRepo(object):
self.commit_map[commit.name] = self.git('rev-parse', 'HEAD').stdout.strip()
self.git('tag', 'tag_%s' % commit.name, self[commit.name])
if commit.is_branch:
- self.git('update-ref', 'branch_%s' % commit.name, self[commit.name])
+ self.git('branch', '-f', 'branch_%s' % commit.name, self[commit.name])
def git(self, *args, **kwargs):
"""Runs a git command specified by |args| in this repo."""
@@ -394,6 +395,9 @@ class GitRepoReadOnlyTestBase(GitRepoSchemaTestBase):
assert cls.REPO is not None
cls.repo = cls.r_schema.reify()
+ def setUp(self):
+ self.repo.git('checkout', '-f', self.repo.last_commit)
+
@classmethod
def tearDownClass(cls):
cls.repo.nuke()
« no previous file with comments | « git_number.py ('k') | tests/git_common_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698