diff options
author | Tzafrir Cohen <tzafrir@cohens.org.il> | 2010-05-02 10:15:13 +0300 |
---|---|---|
committer | Tzafrir Cohen <tzafrir@cohens.org.il> | 2010-05-02 10:15:13 +0300 |
commit | 0769405b9fc35c396996a238fb8330ac8bc00db8 (patch) | |
tree | 124cd9c8f34b9d897eba3d72650af42f57dc044b | |
parent | fa2f67e1fdcd59ca64e4ab52bef7d89030169f45 (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-x | update_branches | 5 |
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 |