From patchwork Sat Feb 22 07:13:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Jonsson X-Patchwork-Id: 11397837 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 027A514E3 for ; Sat, 22 Feb 2020 07:20:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CCFA3208C3 for ; Sat, 22 Feb 2020 07:20:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=zom.bi header.i=@zom.bi header.b="bgVtlfuH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727067AbgBVHUx (ORCPT ); Sat, 22 Feb 2020 02:20:53 -0500 Received: from zom.bi ([78.46.176.20]:59644 "EHLO mx.zom.bi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726821AbgBVHUw (ORCPT ); Sat, 22 Feb 2020 02:20:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=zom.bi; s=dkim; t=1582355625; bh=z3ILin2wEFFfs5tdaI062EmmTJZAWxZdEODggaj2n9I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bgVtlfuHBs0/JFBG4EcgRbBFuMeKXcGz8512NoG/7ZoNnmnaW3oNwC6Zr8eQCEuRD 9fQuASg4kaOpXLmKiR2JJp+sCeaUsw7ydVod+j3Ux5KGyzlnZXqst8dcCSQJCtpNxU mYYC6JVW57D6iJyK6eGHixbcUKPzFSpVAqMbZbAs= From: Rasmus Jonsson To: git@vger.kernel.org Cc: Rasmus Jonsson Subject: [GSoC][PATCH 1/1] t1050: clean up checks for file existence Date: Sat, 22 Feb 2020 08:13:35 +0100 Message-Id: <20200222071335.27292-2-wasmus@zom.bi> In-Reply-To: <20200222071335.27292-1-wasmus@zom.bi> References: <20200222071335.27292-1-wasmus@zom.bi> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Replace "test -f" with test_path_is_file, which gives more verbose and accurate output. Signed-off-by: Rasmus Jonsson --- t/t1050-large.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/t/t1050-large.sh b/t/t1050-large.sh index d3b2adb28b..667fc2a745 100755 --- a/t/t1050-large.sh +++ b/t/t1050-large.sh @@ -53,7 +53,8 @@ test_expect_success 'add a large file or two' ' for p in .git/objects/pack/pack-*.pack do count=$(( $count + 1 )) - if test -f "$p" && idx=${p%.pack}.idx && test -f "$idx" + if test_path_is_file "$p" && idx=${p%.pack}.idx && + test_path_is_file "$idx" then continue fi @@ -65,7 +66,7 @@ test_expect_success 'add a large file or two' ' test $cnt = 2 && for l in .git/objects/??/?????????????????????????????????????? do - test -f "$l" || continue + test_path_is_file "$l" || continue bad=t done && test -z "$bad" && @@ -76,7 +77,8 @@ test_expect_success 'add a large file or two' ' for p in .git/objects/pack/pack-*.pack do count=$(( $count + 1 )) - if test -f "$p" && idx=${p%.pack}.idx && test -f "$idx" + if test_path_is_file "$p" && idx=${p%.pack}.idx && + test_path_is_file "$idx" then continue fi @@ -111,7 +113,7 @@ test_expect_success 'packsize limit' ' count=0 && for pi in .git/objects/pack/pack-*.idx do - test -f "$pi" && count=$(( $count + 1 )) + test_path_is_file "$pi" && count=$(( $count + 1 )) done && test $count = 2 &&