From: Silvio Rhatto Date: Wed, 9 Nov 2016 11:03:17 +0000 (-0200) Subject: Workaround for git-remote at sync-media-remotes X-Git-Tag: 0.2.4~26 X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=c900e6e22548b9a3e34392e1331dd38eead8199b;p=hydra.git Workaround for git-remote at sync-media-remotes --- diff --git a/share/hydractl/sync-media-remotes b/share/hydractl/sync-media-remotes index a3f9146..0bff710 100755 --- a/share/hydractl/sync-media-remotes +++ b/share/hydractl/sync-media-remotes @@ -27,16 +27,18 @@ for folder in `ls $MEDIA`; do addr="`echo $remote | cut -d ' ' -f 2`" type="`echo $remote | cut -d ' ' -f 3`" - if [ "$type" == "(push)" ]; then - command="set-url --add --push" - else - command="add" - fi - if ! git remote -v | sed -e 's/\t/ /g' | grep -q "^$name $addr $type$"; then - # This might not sync everything in the first run as some weird behavior. + # Check if was not already added by a previous command + if ! git remote | grep -q "^$name$"; then + git remote add $name $addr + fi + + # This might not sync everything in the first run due to unreliable "git remote -v" output. # See https://github.com/git/git-scm.com/issues/886 - git remote $command $name $addr + #if [ "$type" == "(push)" ]; then + # git remote set-url --add --push $name $addr + #fi + git remote set-url --add --push $name $addr fi done