add a few more docs to existing funcs

Change-Id: I27317a59aba67c05ca1fd333e8f064c0edccb209
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/343185
Reviewed-by: LaMont Jones <lamontjones@google.com>
Tested-by: Mike Frysinger <vapier@google.com>
This commit is contained in:
Mike Frysinger 2020-12-07 22:04:55 -05:00
parent 39cb17f7a3
commit 790f4cea7a
2 changed files with 13 additions and 0 deletions

View File

@ -158,6 +158,8 @@ def git_require(min_version, fail=False, msg=''):
class GitCommand(object):
"""Wrapper around a single git invocation."""
def __init__(self,
project,
cmdv,

View File

@ -2671,6 +2671,7 @@ class Project(object):
remote.Save()
def _InitMRef(self):
"""Initialize the pseudo m/<manifest branch> ref."""
if self.manifest.branch:
if self.use_git_worktrees:
# Set up the m/ space to point to the worktree-specific ref space.
@ -2700,6 +2701,16 @@ class Project(object):
self._InitAnyMRef(HEAD, self.bare_git)
def _InitAnyMRef(self, ref, active_git, detach=False):
"""Initialize |ref| in |active_git| to the value in the manifest.
This points |ref| to the <project> setting in the manifest.
Args:
ref: The branch to update.
active_git: The git repository to make updates in.
detach: Whether to update target of symbolic refs, or overwrite the ref
directly (and thus make it non-symbolic).
"""
cur = self.bare_ref.symref(ref)
if self.revisionId: