summaryrefslogtreecommitdiff
path: root/share/hydractl/sync-media-remotes
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2016-11-09 09:03:17 -0200
committerSilvio Rhatto <rhatto@riseup.net>2016-11-09 09:03:17 -0200
commitc900e6e22548b9a3e34392e1331dd38eead8199b (patch)
tree98a8463a05460765864e6ab6203906bf263d7e04 /share/hydractl/sync-media-remotes
parent88e3a4131b2f8ead94ce8a808427d080cc411629 (diff)
downloadhydra-c900e6e22548b9a3e34392e1331dd38eead8199b.tar.gz
hydra-c900e6e22548b9a3e34392e1331dd38eead8199b.tar.bz2
Workaround for git-remote at sync-media-remotes
Diffstat (limited to 'share/hydractl/sync-media-remotes')
-rwxr-xr-xshare/hydractl/sync-media-remotes18
1 files changed, 10 insertions, 8 deletions
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