summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorUnknwon <joe2010xtmf@163.com>2014-08-26 18:11:27 +0800
committerUnknwon <joe2010xtmf@163.com>2014-08-26 18:11:27 +0800
commit50de06056be67ab8433fa796608e38004f2e8733 (patch)
tree5047f12a9aa9fa454a2ff1ca106255ea3ad87b26 /models
parent74b31566cf5caaf6bf73584e621d56ca99c048d1 (diff)
parent66c9c86219b66baa1c6db1543a04494bda3f39c4 (diff)
downloadgitea-50de06056be67ab8433fa796608e38004f2e8733.tar.gz
gitea-50de06056be67ab8433fa796608e38004f2e8733.zip
Merge branch 'dev' of github.com:gogits/gogs into dev
Diffstat (limited to 'models')
-rw-r--r--models/repo.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/models/repo.go b/models/repo.go
index c3e9423f45..62bac9f1ef 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -305,17 +305,17 @@ func MigrateRepository(u *User, name, desc string, private, mirror bool, url str
return repo, errors.New("git clone: " + stderr)
}
- // Pull data from source.
+ // Add remote and fetch data.
if _, stderr, err = process.ExecDir(3*time.Minute,
tmpDir, fmt.Sprintf("MigrateRepository(git pull): %s", repoPath),
- "git", "pull", url); err != nil {
- return repo, errors.New("git pull: " + stderr)
+ "git", "remote", "add", "-f", "--tags", "upstream", url); err != nil {
+ return repo, errors.New("git remote: " + stderr)
}
// Push data to local repository.
if _, stderr, err = process.ExecDir(3*time.Minute,
tmpDir, fmt.Sprintf("MigrateRepository(git push): %s", repoPath),
- "git", "push", "origin", "master"); err != nil {
+ "git", "push", "--tags", "origin", "refs/remotes/upstream/*:refs/heads/*"); err != nil {
return repo, errors.New("git push: " + stderr)
}