mirror of
https://github.com/go-gitea/git.git
synced 2026-07-01 20:34:42 -04:00
gogits/gogs#3233 code clean up
This commit is contained in:
@@ -10,7 +10,7 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const _VERSION = "0.3.4"
|
||||
const _VERSION = "0.3.5"
|
||||
|
||||
func Version() string {
|
||||
return _VERSION
|
||||
|
||||
@@ -43,6 +43,15 @@ func (repo *Repository) parsePrettyFormatLogToList(logs []byte) (*list.List, err
|
||||
return l, nil
|
||||
}
|
||||
|
||||
// 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
|
||||
}
|
||||
|
||||
// InitRepository initializes a new Git repository.
|
||||
func InitRepository(repoPath string, bare bool) error {
|
||||
os.MkdirAll(repoPath, os.ModePerm)
|
||||
@@ -141,9 +150,9 @@ func Push(repoPath, remote, branch string) error {
|
||||
}
|
||||
|
||||
type CheckoutOptions struct {
|
||||
Branch string
|
||||
Branch string
|
||||
OldBranch string
|
||||
Timeout time.Duration
|
||||
Timeout time.Duration
|
||||
}
|
||||
|
||||
// Checkout checkouts a branch
|
||||
|
||||
Reference in New Issue
Block a user