From a3142b59d8846cc3a2c465e91bf0fcc45149f840 Mon Sep 17 00:00:00 2001 From: Alex Dergachev Date: Fri, 12 Dec 2014 22:55:49 +0000 Subject: [PATCH] Minor cleanup --- app/models/repository/git_remote.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/models/repository/git_remote.rb b/app/models/repository/git_remote.rb index ad9b832..851ea6c 100644 --- a/app/models/repository/git_remote.rb +++ b/app/models/repository/git_remote.rb @@ -97,7 +97,7 @@ class Repository::GitRemote < Repository::Git end 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? unless two_remotes_equal(existing_repo_remote, clone_url) @@ -119,7 +119,10 @@ class Repository::GitRemote < Repository::Git 'GitRemote' end + # TODO: first validate git URL and display error message def parse(url) + url.strip! + ret = {} # start with http://github.com/evolvingweb/git_remote or git@git.ewdev.ca:some/repo.git ret[:url] = url