Minor cleanup

This commit is contained in:
Alex Dergachev 2014-12-12 22:55:49 +00:00
parent aee9f0eccd
commit a3142b59d8

View File

@ -97,7 +97,7 @@ class Repository::GitRemote < Repository::Git
end end
if Dir.exists? clone_path if Dir.exists? clone_path
existing_repo_remote, err, status = Open3::capture3("git", "--git-dir", clone_path, "config", "--get", "remote.origin.url") existing_repo_remote, status = Open3::capture2("git", "--git-dir", clone_path, "config", "--get", "remote.origin.url")
return "Unable to run: git --git-dir #{clone_path} config --get remote.origin.url" unless status.success? return "Unable to run: git --git-dir #{clone_path} config --get remote.origin.url" unless status.success?
unless two_remotes_equal(existing_repo_remote, clone_url) unless two_remotes_equal(existing_repo_remote, clone_url)
@ -119,7 +119,10 @@ class Repository::GitRemote < Repository::Git
'GitRemote' 'GitRemote'
end end
# TODO: first validate git URL and display error message
def parse(url) def parse(url)
url.strip!
ret = {} ret = {}
# start with http://github.com/evolvingweb/git_remote or git@git.ewdev.ca:some/repo.git # start with http://github.com/evolvingweb/git_remote or git@git.ewdev.ca:some/repo.git
ret[:url] = url ret[:url] = url