From 272430a170a49cfa7e3400e1dbaddc2f6e97f495 Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Mon, 1 Oct 2018 11:37:53 +1300 Subject: [PATCH] Avoid error on stderr with older git Discard stderr when trying to use git worktree, which is a fairly recent addition. (cherry picked from commit c6e458380e674adaabb61ef3b2ae5c2c3aca16f4) --- bootstrap | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bootstrap b/bootstrap index 5464e5dd9..a3a6ab63a 100755 --- a/bootstrap +++ b/bootstrap @@ -183,7 +183,10 @@ lazy_build() { # Download the tarball if required. if [ ! -f "$tarball" ] ; then main_tarball= - main_worktree_dir=`git worktree list --porcelain|sed 's/^worktree //;q'` + # Older git versions don't support "git worktree", so discard stderr and + # then we'll skip the worktree handling because main_worktree_dir will + # be empty. + main_worktree_dir=`git worktree list --porcelain 2>/dev/null|sed 's/^worktree //;q'` if [ -n "$main_worktree_dir" ] ; then # Canonicalise main_worktree_dir before comparing with pwd. main_worktree_dir=`cd "$main_worktree_dir" && pwd` -- 2.11.4.GIT