add git_assure_remote to the lib
authorMicah Anderson <micah@riseup.net>
Fri, 25 Jan 2013 16:02:04 +0000 (11:02 -0500)
committerMicah Anderson <micah@riseup.net>
Fri, 25 Jan 2013 16:02:04 +0000 (11:02 -0500)
.mrconfig

index 5cd4106..abd8977 100644 (file)
--- a/.mrconfig
+++ b/.mrconfig
@@ -1,3 +1,21 @@
+[DEFAULT]
+
+lib = 
+    git_assure_remote() {
+        remote="$1"
+        url="$2"
+        git remote | grep -q "^$remote$" || {
+            echo I: Adding remote $remote
+            git remote add "$remote" "$url"
+            git fetch "$remote"
+        }
+        git remote -v | grep "^$remote" | grep -q "$url" || {
+            echo I: Changing remote URL for $remote
+            git remote set-url $remote $url
+            git fetch "$remote"
+        }
+    }
+
 # general repos
 
 [gitolite-admin]
 # general repos
 
 [gitolite-admin]