mirror of
https://github.com/MichaelMure/git-bug.git
synced 2024-12-15 10:12:06 +03:00
repository: improve documentation and fix typo mistake
This commit is contained in:
parent
9304808070
commit
b85b2c57a7
@ -31,7 +31,7 @@ func newGitConfig(repo *GitRepo, global bool) *gitConfig {
|
||||
|
||||
// StoreConfig store a single key/value pair in the config of the repo
|
||||
func (gc *gitConfig) StoreString(key string, value string) error {
|
||||
_, err := gc.repo.runGitCommand("config", "gc.localityFlag", "--replace-all", key, value)
|
||||
_, err := gc.repo.runGitCommand("config", gc.localityFlag, "--replace-all", key, value)
|
||||
return err
|
||||
}
|
||||
|
||||
@ -45,7 +45,7 @@ func (gc *gitConfig) StoreTimestamp(key string, value time.Time) error {
|
||||
|
||||
// ReadConfigs read all key/value pair matching the key prefix
|
||||
func (gc *gitConfig) ReadAll(keyPrefix string) (map[string]string, error) {
|
||||
stdout, err := gc.repo.runGitCommand("config", "gc.localityFlag", "--get-regexp", keyPrefix)
|
||||
stdout, err := gc.repo.runGitCommand("config", gc.localityFlag, "--get-regexp", keyPrefix)
|
||||
|
||||
// / \
|
||||
// / ! \
|
||||
@ -78,7 +78,7 @@ func (gc *gitConfig) ReadAll(keyPrefix string) (map[string]string, error) {
|
||||
}
|
||||
|
||||
func (gc *gitConfig) ReadString(key string) (string, error) {
|
||||
stdout, err := gc.repo.runGitCommand("config", "gc.localityFlag", "--get-all", key)
|
||||
stdout, err := gc.repo.runGitCommand("config", gc.localityFlag, "--get-all", key)
|
||||
|
||||
// / \
|
||||
// / ! \
|
||||
@ -120,12 +120,12 @@ func (gc *gitConfig) ReadTimestamp(key string) (*time.Time, error) {
|
||||
}
|
||||
|
||||
func (gc *gitConfig) rmSection(keyPrefix string) error {
|
||||
_, err := gc.repo.runGitCommand("config", "gc.localityFlag", "--remove-section", keyPrefix)
|
||||
_, err := gc.repo.runGitCommand("config", gc.localityFlag, "--remove-section", keyPrefix)
|
||||
return err
|
||||
}
|
||||
|
||||
func (gc *gitConfig) unsetAll(keyPrefix string) error {
|
||||
_, err := gc.repo.runGitCommand("config", "gc.localityFlag", "--unset-all", keyPrefix)
|
||||
_, err := gc.repo.runGitCommand("config", gc.localityFlag, "--unset-all", keyPrefix)
|
||||
return err
|
||||
}
|
||||
|
||||
|
@ -30,12 +30,12 @@ type GitRepo struct {
|
||||
editClock *lamport.Persisted
|
||||
}
|
||||
|
||||
// LocalConfig .
|
||||
// LocalConfig give access to the repository scoped configuration
|
||||
func (repo *GitRepo) LocalConfig() Config {
|
||||
return newGitConfig(repo, false)
|
||||
}
|
||||
|
||||
// GlobalConfig .
|
||||
// GlobalConfig give access to the git global configuration
|
||||
func (repo *GitRepo) GlobalConfig() Config {
|
||||
return newGitConfig(repo, true)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user