aboutsummaryrefslogtreecommitdiffstats
path: root/models/repo.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2016-08-15 22:20:55 -0700
committerUnknwon <u@gogs.io>2016-08-15 22:20:55 -0700
commit2625193a4820a89355ca1b8b7c910f0f4243baab (patch)
treec948d66e4e968caaff0109f808878af45bed0eec /models/repo.go
parentf3c325892139a4dae84ceda773b7caf5aef67d33 (diff)
downloadgitea-2625193a4820a89355ca1b8b7c910f0f4243baab.tar.gz
gitea-2625193a4820a89355ca1b8b7c910f0f4243baab.zip
models/repo_editor: improve code quality
Diffstat (limited to 'models/repo.go')
-rw-r--r--models/repo.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/models/repo.go b/models/repo.go
index 2eb63f54c5..6c427f92ec 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -461,26 +461,26 @@ func UpdateLocalCopyBranch(repoPath, localPath, branch string) error {
Timeout: time.Duration(setting.Git.Timeout.Clone) * time.Second,
Branch: branch,
}); err != nil {
- return fmt.Errorf("Clone: %v", err)
+ return fmt.Errorf("git clone %s: %v", branch, err)
}
} else {
if err := git.Checkout(localPath, git.CheckoutOptions{
Branch: branch,
}); err != nil {
- return fmt.Errorf("Checkout: %v", err)
+ return fmt.Errorf("git checkout %s: %v", branch, err)
}
if err := git.Pull(localPath, git.PullRemoteOptions{
+ Timeout: time.Duration(setting.Git.Timeout.Pull) * time.Second,
Remote: "origin",
Branch: branch,
- Timeout: time.Duration(setting.Git.Timeout.Pull) * time.Second,
}); err != nil {
- return fmt.Errorf("Pull: %v", err)
+ return fmt.Errorf("git pull origin %s: %v", branch, err)
}
}
return nil
}
-// UpdateLocalCopy makes sure the branch of local copy of repository is up-to-date.
+// UpdateLocalCopyBranch makes sure local copy of repository in given branch is up-to-date.
func (repo *Repository) UpdateLocalCopyBranch(branch string) error {
return UpdateLocalCopyBranch(repo.RepoPath(), repo.LocalCopyPath(), branch)
}