repository: improve documentation and fix typo mistake

amine created

Change summary

repository/config_git.go | 10 +++++-----
repository/git.go        |  4 ++--
2 files changed, 7 insertions(+), 7 deletions(-)

Detailed changes

repository/config_git.go 🔗

@@ -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
 }
 

repository/git.go 🔗

@@ -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)
 }