aboutsummaryrefslogtreecommitdiffstats
path: root/modules/git/repo.go
diff options
context:
space:
mode:
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
}