This commit is contained in:
Unknwon
2016-08-11 10:52:26 -07:00
parent 18dd87dc5e
commit efc90b5ea1
2 changed files with 12 additions and 3 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ import (
"time"
)
const _VERSION = "0.3.4"
const _VERSION = "0.3.5"
func Version() string {
return _VERSION
+11 -2
View File
@@ -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