summaryrefslogtreecommitdiff
path: root/git-mirror-gitlab-ee
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-12-16 14:13:58 -0500
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-12-16 14:13:58 -0500
commit6526d636349bd730507af8c526e5f1e138f2a475 (patch)
treec181c4f25c9ecb56edfad8326e799e6caa596ed0 /git-mirror-gitlab-ee
parent1714205f993f91f9dae9d2b7d77e51286bf38703 (diff)
Avoid unnescessary data pushes
Diffstat (limited to 'git-mirror-gitlab-ee')
-rwxr-xr-xgit-mirror-gitlab-ee7
1 files changed, 5 insertions, 2 deletions
diff --git a/git-mirror-gitlab-ee b/git-mirror-gitlab-ee
index aaca9b7..2ec79f3 100755
--- a/git-mirror-gitlab-ee
+++ b/git-mirror-gitlab-ee
@@ -52,8 +52,11 @@ class GitLabEE < GitLabCE
end
def mirrorURL=(url)
- libremessages('msg2', 'Setting mirror URL for %s', @project_id)
- self.mirrorURL()
+ if self.mirrorURL == URI(url)
+ libremessages('msg2', 'Mirror URL ok')
+ return self.mirrorURL
+ end
+ libremessages('msg2', 'Setting mirror URL')
req = Net::HTTP::Patch.new(URI(self.info["web_url"]+"/mirror"))
req.add_field("PRIVATE-TOKEN", @gl.config['apikey']) # authenticate