repos

package
v0.0.0-...-f204870 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 28, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllCommits

func AllCommits(repoName RepoName) ([]string, error)

AllCommits returns the list of commits formatted as "ID DATE". @llr REQ-TRAQ-SWL-16

func CleanupTemporaryDirectories

func CleanupTemporaryDirectories()

Removes any temporary directories where repositories have been cloned @llr REQ-TRAQ-SWL-49

func ClearAllRepositories

func ClearAllRepositories()

Unregisters all repositories from the registry, leaving it empty @llr REQ-TRAQ-SWL-49

func FindFilesInDirectory

func FindFilesInDirectory(repoName RepoName, path string, pattern *regexp.Regexp, ignoredPaths []*regexp.Regexp) ([]string, error)

Finds files in the given repository, returning an array of paths to each matched file Its arguments are: - `repoName`: Repo where files are located - `path`: The path to look in. Only files in this path (relative to the root of the repo) will be matched. - `pattern` The pattern to match against. If the pattern matches, it is added to the result array. - `ignoredPaths`: Any ignored path regexp. If the file matches any regular expression in this array it will not be matched @llr REQ-TRAQ-SWL-49, REQ-TRAQ-SWL-51

func PathInRepo

func PathInRepo(repoName RepoName, path string) (string, error)

Returns an absolute path to a file inside a repository. It validates that the file exists. If it doesn't an error is returned. @llr REQ-TRAQ-SWL-49, REQ-TRAQ-SWL-51

func RegisterRepository

func RegisterRepository(name RepoName, path RepoPath)

Registers a repository in the registry, that can be queried using the repository name. @llr REQ-TRAQ-SWL-49

func SetBaseRepoInfo

func SetBaseRepoInfo(repoPath RepoPath, repoName RepoName)

Collects the information about the base repository (the repository where the reqtraq command is run) @llr REQ-TRAQ-SWL-49

Types

type RemotePath

type RemotePath string

A reference to a remote repository that can be one of:

  • An HTTP url referencing a remote git repository
  • A ssh url referencing a remote git repository
  • A git url referencing a remote git repository
  • A local repository that will be cloned

TODO(ja): Allow the user to specify a custom branch/git ref in this path

type RepoName

type RepoName string

Identifies a single repository

func BaseRepoName

func BaseRepoName() RepoName

Returns the name to the base repository. Requires that SetBaseRepoInfo has been called before. @llr REQ-TRAQ-SWL-49

type RepoPath

type RepoPath string

A path to a local repository that is present in the current filesystem

func BaseRepoPath

func BaseRepoPath() RepoPath

Returns the local path to the base repository. Requires that SetBaseRepoInfo has been called before. @llr REQ-TRAQ-SWL-49

func GetRepo

func GetRepo(repoName RepoName, remotePath RemotePath, gitReference string, override bool) (RepoPath, error)

Gets the local path to a repository by name. The remotePath will be used to create a local repository copy if the repository is not registered or the override flag is set. @llr REQ-TRAQ-SWL-49, REQ-TRAQ-SWL-50

func GetRepoPathByName

func GetRepoPathByName(name RepoName) (RepoPath, error)

Obtains the local path to a repository from its name, if the repository is registered @llr REQ-TRAQ-SWL-49

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL