From b8c060e8f6929ed7c5147b6b495f23ddae90a6ce Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Tue, 11 Feb 2014 13:24:22 -0800 Subject: [PATCH] clone.sh: suppress "--mirror is dangerous" warning Newer Git versions spew a warning when --mirror is used without "=fetch" or "=push", but older versions do not accept the "=xxx" argument. Send any possible warning to /dev/null to remain compatible while not showing the ugly warning when using more recent Git versions. This only happens with the git remote add command, the git clone command continues to only accept an unadorned --mirror and does not spew any warning. Go figure. --- taskd/clone.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/taskd/clone.sh b/taskd/clone.sh index 4e32956..ad82a3b 100755 --- a/taskd/clone.sh +++ b/taskd/clone.sh @@ -122,7 +122,9 @@ case "$url" in ;; *) git remote rm origin >/dev/null 2>&1 || : - git remote add --mirror origin "$url" + # starting with Git 1.7.5 --mirror by itself will spew a warning + # since we support older Git versions, just toss the warning + git remote add --mirror origin "$url" 2>/dev/null GIT_SSL_NO_VERIFY=1 git remote update GIT_SSL_NO_VERIFY=1 git remote prune origin ;; -- 2.11.4.GIT