mirror of
https://github.com/grdl/git-get.git
synced 2026-02-08 08:44:18 +00:00
Fix missing fetch call
This commit is contained in:
@@ -17,7 +17,7 @@ type Loaded struct {
|
||||
}
|
||||
|
||||
// Load reads status of a repository at a given path.
|
||||
func Load(path string) *Loaded {
|
||||
func Load(path string, fetch bool) *Loaded {
|
||||
loaded := &Loaded{
|
||||
path: path,
|
||||
branches: make(map[string]string),
|
||||
@@ -30,6 +30,13 @@ func Load(path string) *Loaded {
|
||||
return loaded
|
||||
}
|
||||
|
||||
if fetch {
|
||||
err = repo.Fetch()
|
||||
if err != nil {
|
||||
loaded.errors = append(loaded.errors, err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
loaded.current, err = repo.CurrentBranch()
|
||||
if err != nil {
|
||||
loaded.errors = append(loaded.errors, err.Error())
|
||||
|
||||
Reference in New Issue
Block a user