Clone remote git repository
this patch clones the repository of a remote GIT repository.
enter the public clone URL (git://..../.git) it will clone it to RAILS_ROOT/repositories/git/<project identifier>/<repository name>
It also changes the URL to use the local clone.
#2 Updated by Thomas Lecavelier about 12 years ago
Test cases are missing. I know it wouldn't be easy but you can try to accept "not so remote" repository in tmp dir.
Not tested, but the dir variable in the diff could break if white spaces appear: please protect this var expansion in the command line with simple quotes.
#4 Updated by Gabriel Mazetto over 8 years ago
Toshi MARUYAMA wrote:
As I described #7494 note 2,
I think Redmine core should not have this feature.
It is impossible to test.
Plugins should provide this feature.
It is not impossible, it can be a little tricky, but still really possible. A easy test case could be: get a dummy git bare repository in the test folder, then run git-daemon configured to provide this dummy repository. The unit test will have to add a repository from git://localhost/1.git (for example) and then check to see if the folder was correctly created and if it's a git repository.
Also there is the "git" rubygem that can make it easy to clone and fetch revisions:
require 'git' Git.clone('git://github.com/.../repo.git', '/destination/path.git', :bare => true)
git = Git.open('/destination/path.git', :log => Logger.new(STDOUT)) git.fetch('origin')
It can't be easier then that. Implementing this "feature" will make redmine usable with git.