From 0769405b9fc35c396996a238fb8330ac8bc00db8 Mon Sep 17 00:00:00 2001 From: Tzafrir Cohen Date: Sun, 2 May 2010 10:15:13 +0300 Subject: 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). --- update_branches | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3