@@ -78,28 +78,34 @@ module RBS
7878
7979 def cp_r : (Pathname, Pathname) -> void
8080
81- # Ensure the git repository status is expected one
81+ # Ensure the git repository exists, and
8282 #
83- # * It exists, and
84- # * The `HEAD` is the `revision`
83+ # * When `revision` is a commit hash, the commit exists in the local repository, or
84+ # * When `revision` is a branch name, the latest version is fetched from `origin`
85+ #
86+ # It may require a network connection to fetch or clone the repository from remote.
87+ #
88+ # * If `revision` is a commit hash and the commit doesn't exists in the local repository, it runs `git fetch`
89+ # * If `revision` is a branch name, it runs `git fetch` once per instance
8590 #
8691 def setup! : [T] () { () -> T } -> T
8792 | () -> void
8893
8994 def need_to_fetch? : (String revision) -> bool
9095
96+ # The full path of local git repository
9197 def git_dir : () -> Pathname
9298
99+ # The full path of `repo_dir` in the local git repository
93100 def gem_repo_dir : () -> Pathname
94101
95- def with_revision : [T] () { () -> T } -> T
96-
97102 # Returns `true` if `revision` looks like a commit hash
98- #
99103 def commit_hash? : () -> bool
100104
105+ # Executes a git command, raises an error if failed
101106 def git : (*String cmd, **untyped opt) -> String
102107
108+ # Executes a git command, returns `nil` if failed
103109 def git? : (*String cmd, **untyped opt) -> String?
104110
105111 def sh! : (*String cmd, **untyped opt) -> String
0 commit comments