summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTzafrir Cohen <tzafrir@cohens.org.il>2010-05-02 10:15:13 +0300
committerTzafrir Cohen <tzafrir@cohens.org.il>2010-05-02 10:15:13 +0300
commit0769405b9fc35c396996a238fb8330ac8bc00db8 (patch)
tree124cd9c8f34b9d897eba3d72650af42f57dc044b
parentfa2f67e1fdcd59ca64e4ab52bef7d89030169f45 (diff)
Fix update_branches for a cloned repo
Allow update_branches to be safely used also in the case where this repo clones a remote svn repo (as well as locally).
-rwxr-xr-xupdate_branches5
1 files changed, 4 insertions, 1 deletions
diff --git a/update_branches b/update_branches
index e3a7399..6728c00 100755
--- a/update_branches
+++ b/update_branches
@@ -1,6 +1,9 @@
#!/bin/sh
-git branch -r | grep -v 'tags/' | sed -e 's/^ *\([^ ]*\)/svn_\1 \1/' \
+remotes_pat=`git remote show | sed -e 's|$|/|' | xargs | tr ' ' '|'`
+
+git branch -r | grep -v 'tags/' | egrep -v "$remotes_pat" \
+ | sed -e 's/^ *\([^ ]*\)/svn_\1 \1/' \
| while read local remote; do
git branch --track -f $local $remote
done