Fix getGitRemote function
Change-Id: I8ef9d23f34b295fdb9b42d843219afa49b5b10d8
diff --git a/src/com/mirantis/mk/Git.groovy b/src/com/mirantis/mk/Git.groovy
index 4bfc3d7..eccc03e 100644
--- a/src/com/mirantis/mk/Git.groovy
+++ b/src/com/mirantis/mk/Git.groovy
@@ -42,12 +42,12 @@
/**
* Get remote URL
*
- * @param name Name of remote (default origin)
+ * @param name Name of remote (default any)
* @param type Type (fetch or push, default fetch)
*/
-def getGitRemote(name = 'origin', type = 'fetch') {
+def getGitRemote(name = '', type = 'fetch') {
gitRemote = sh (
- script: "git remote | grep ${name} | grep ${type} | awk '{print \$2}'",
+ script: "git remote -v | grep '${name}' | grep ${type} | awk '{print \$2}' | head -1",
returnStdout: true
).trim()
return gitRemote