From ec7ed4969c97d2091859cbc20c53fceee1d84688 Mon Sep 17 00:00:00 2001 From: Sami Samhuri Date: Tue, 24 Nov 2009 09:57:57 -0800 Subject: [PATCH] [FIXED] bug in mkgit-nofxwiki.net --- mkgit-nofxwiki.net | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/mkgit-nofxwiki.net b/mkgit-nofxwiki.net index fd18878..784c6f9 100755 --- a/mkgit-nofxwiki.net +++ b/mkgit-nofxwiki.net @@ -1,6 +1,15 @@ #!/bin/sh -ssh nofxwiki.net "/home/sjs/bin/mkgit $1" -git remote add -m master origin ssh://nofxwiki.net/var/git/$1.git -git config branch.master.merge refs/heads/master -git push origin master +function die() { + echo "[error] $*" + exit 1 +} + +ssh nofxwiki.net "/home/sjs/bin/mkgit $1" || die "Can't create remote git repo" +if git remote show origin >/dev/null 2>&1; then + git remote rm origin +fi +git remote add -m master origin ssh://nofxwiki.net/var/git/$1.git || die "Can't add remote origin" +git config branch.master.remote origin || die "Can't set master's branch remote origin" +git config branch.master.merge refs/heads/master || die "Can't set master's branch merge" +git push origin master || die "Can't push to remote repo"