summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2017-04-21 23:43:37 +0200
committerJonas Smedegaard <dr@jones.dk>2017-04-21 23:43:37 +0200
commitde99bc4db19f6056e7a7c644c21485a1ba22c622 (patch)
tree780d95c077a744a95ce512dae86b86f841bc9f02
parent20d29799809f3e3bbf1824a0cd73c4a668e8c5cb (diff)
Tolerate failiure initializing git (fails if done already but by different user and in subdir).
-rwxr-xr-xlocalgit-remote-init-push3
1 files changed, 2 insertions, 1 deletions
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