From 790f4cea7aa95667296e0aa22eb0690df91c45e8 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Mon, 7 Dec 2020 22:04:55 -0500 Subject: [PATCH] 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 Tested-by: Mike Frysinger --- git_command.py | 2 ++ project.py | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/git_command.py b/git_command.py index 5d73c281..a1769270 100644 --- a/git_command.py +++ b/git_command.py @@ -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, diff --git a/project.py b/project.py index 894fb38a..2b57a5fb 100644 --- a/project.py +++ b/project.py @@ -2671,6 +2671,7 @@ class Project(object): remote.Save() def _InitMRef(self): + """Initialize the pseudo m/ 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 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: