summaryrefslogtreecommitdiffstats
path: root/modules/git/repo.go
diff options
context:
space:
mode:
authorkolaente <konrad@kola-entertainments.de>2019-06-12 21:41:28 +0200
committertechknowlogick <techknowlogick@gitea.io>2019-06-12 15:41:28 -0400
commitf9ec2f89f2265bc1371a6c62359de9816534fa6b (patch)
treef48b138a457e5ac6cf843bbb38400926704370f7 /modules/git/repo.go
parent5832f8d90df2d72cb38698c3e9050f2b29717dc7 (diff)
downloadgitea-f9ec2f89f2265bc1371a6c62359de9816534fa6b.tar.gz
gitea-f9ec2f89f2265bc1371a6c62359de9816534fa6b.zip
Add golangci (#6418)
Diffstat (limited to 'modules/git/repo.go')
-rw-r--r--modules/git/repo.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/modules/git/repo.go b/modules/git/repo.go
index 4be3164130..f5d7ee63bb 100644
--- a/modules/git/repo.go
+++ b/modules/git/repo.go
@@ -58,21 +58,21 @@ func (repo *Repository) parsePrettyFormatLogToList(logs []byte) (*list.List, err
// IsRepoURLAccessible checks if given repository URL is accessible.
func IsRepoURLAccessible(url string) bool {
_, err := NewCommand("ls-remote", "-q", "-h", url, "HEAD").Run()
- if err != nil {
- return false
- }
- return true
+ return err == nil
}
// InitRepository initializes a new Git repository.
func InitRepository(repoPath string, bare bool) error {
- os.MkdirAll(repoPath, os.ModePerm)
+ err := os.MkdirAll(repoPath, os.ModePerm)
+ if err != nil {
+ return err
+ }
cmd := NewCommand("init")
if bare {
cmd.AddArguments("--bare")
}
- _, err := cmd.RunInDir(repoPath)
+ _, err = cmd.RunInDir(repoPath)
return err
}