whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@apache.org
Subject [whimsy] branch master updated: track the location of git repositories as they change
Date Thu, 22 Jun 2017 02:25:49 GMT
This is an automated email from the ASF dual-hosted git repository.

rubys pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new 584d79b  track the location of git repositories as they change
584d79b is described below

commit 584d79bc977928621cebf04446d7a7d3896f8d22
Author: Sam Ruby <rubys@intertwingly.net>
AuthorDate: Wed Jun 21 22:25:29 2017 -0400

    track the location of git repositories as they change
---
 Rakefile | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/Rakefile b/Rakefile
index aeef4aa..564acf4 100644
--- a/Rakefile
+++ b/Rakefile
@@ -137,12 +137,21 @@ namespace :git do
 
           puts
           puts File.join(Dir.pwd, name)
+
           if Dir.exist? name
             Dir.chdir(name) do
+              # update the location of the remote, if necessary
+              remote = `git config --get remote.origin.url`.chomp
+              if remote != (base + description['url']).to_s
+                `git config remote.origin.url #{base + description['url']}`
+              end
+
+              # pull changes
               system "git checkout #{branch}" if branch
               system 'git pull'
             end
           else
+            # fresh checkout
             system 'git', 'clone', (base + description['url']).to_s, name
             Dir.chdir(name) {system "git checkout #{branch}"} if branch
           end

-- 
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" <commits@whimsical.apache.org>'].

Mime
View raw message