summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorVyacheslav Bakhmutov <m0sth8@yandex-team.ru>2014-08-25 20:28:14 +0700
committerVyacheslav Bakhmutov <m0sth8@yandex-team.ru>2014-08-25 20:28:14 +0700
commit95a594d75aa14898ff266850fb3e65636a9396a9 (patch)
tree2a64602a2e7c003abc79d778181fec539ac05f27 /models
parentf2c263c54facdcbc9375a47535c0389fd7d05875 (diff)
downloadgitea-95a594d75aa14898ff266850fb3e65636a9396a9.tar.gz
gitea-95a594d75aa14898ff266850fb3e65636a9396a9.zip
Migrate all branches and tags
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 f5d1ca834e..08c9f8dc25 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)
}