Skip to content

Commit a3142b5

Browse files
committed
Minor cleanup
1 parent aee9f0e commit a3142b5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

app/models/repository/git_remote.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def ensure_possibly_empty_clone_exists
9797
end
9898

9999
if Dir.exists? clone_path
100-
existing_repo_remote, err, status = Open3::capture3("git", "--git-dir", clone_path, "config", "--get", "remote.origin.url")
100+
existing_repo_remote, status = Open3::capture2("git", "--git-dir", clone_path, "config", "--get", "remote.origin.url")
101101
return "Unable to run: git --git-dir #{clone_path} config --get remote.origin.url" unless status.success?
102102

103103
unless two_remotes_equal(existing_repo_remote, clone_url)
@@ -119,7 +119,10 @@ def self.scm_name
119119
'GitRemote'
120120
end
121121

122+
# TODO: first validate git URL and display error message
122123
def parse(url)
124+
url.strip!
125+
123126
ret = {}
124127
# start with http://github.com/evolvingweb/git_remote or [email protected]:some/repo.git
125128
ret[:url] = url

0 commit comments

Comments
 (0)