From de99bc4db19f6056e7a7c644c21485a1ba22c622 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Fri, 21 Apr 2017 23:43:37 +0200 Subject: Tolerate failiure initializing git (fails if done already but by different user and in subdir). --- localgit-remote-init-push | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'localgit-remote-init-push') diff --git a/localgit-remote-init-push b/localgit-remote-init-push index 5d8efd5..c581bde 100755 --- a/localgit-remote-init-push +++ b/localgit-remote-init-push @@ -68,6 +68,7 @@ GIT_REMOTE=${4:-origin} [ origin != "$GIT_REMOTE" ] || ORIGIN_IS_DEFAULT=yes -[ -z "$SSH_CONN" ] || ssh "$SSH_CONN" git init --bare --shared "$BASEPATH"/"$PROJECT".git +# TODO: handle /~ BASEPATH specially and stop blindly ignore any error +[ -z "$SSH_CONN" ] || ssh "$SSH_CONN" git init --bare --shared "$BASEPATH"/"$PROJECT".git || true git remote add "$GIT_REMOTE" "$SSH_CONN":"$BASEPATH"/"$PROJECT".git git push ${ORIGIN_IS_DEFAULT:+--set-upstream} "$GIT_REMOTE" master -- cgit v1.2.3