xref: /aosp_15_r20/external/skia/infra/bots/recipe_modules/git/api.py (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
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.joinpath('git')
17    git_bin = git_dir.joinpath('bin')
18    return self.m.env({'PATH': self.m.path.pathsep.join(
19        [str(git_dir), str(git_bin), '%(PATH)s'])})
20