1# Copyright 2017 The Chromium Authors. All rights reserved. 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4 5 6from recipe_engine import recipe_api 7 8 9class GitApi(recipe_api.RecipeApi): 10 def env(self): 11 """Add Git to PATH 12 13 Requires the infra/git and infra/tools/git CIPD packages to be installed 14 in the 'git' relative path. 15 """ 16 git_dir = self.m.path['start_dir'].join('git') 17 git_bin = git_dir.join('bin') 18 return self.m.env({'PATH': self.m.path.pathsep.join( 19 [str(git_dir), str(git_bin), '%(PATH)s'])}) 20