From patchwork Fri Jan 18 22:26:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Wong X-Patchwork-Id: 10771721 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 795E914E5 for ; Fri, 18 Jan 2019 22:26:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 678B4300FA for ; Fri, 18 Jan 2019 22:26:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5C12630873; Fri, 18 Jan 2019 22:26:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F0013300FA for ; Fri, 18 Jan 2019 22:26:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729958AbfARW0c (ORCPT ); Fri, 18 Jan 2019 17:26:32 -0500 Received: from dcvr.yhbt.net ([64.71.152.64]:42770 "EHLO dcvr.yhbt.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729933AbfARW0c (ORCPT ); Fri, 18 Jan 2019 17:26:32 -0500 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id A00991F453; Fri, 18 Jan 2019 22:26:31 +0000 (UTC) Date: Fri, 18 Jan 2019 22:26:29 +0000 From: Eric Wong To: David Turner , Junio C Hamano Cc: git@vger.kernel.org Subject: [PATCH] t1512: test ambiguous cat-file --batch and --batch-output Message-ID: <20190118222629.3nvcos24gmi6xe4i@dcvr> References: <20190118033845.s2vlrb3wd3m2jfzu@dcvr> <20190118104519.fqpzirux5qulkcwa@dcvr> <672a6fb9e480becbfcb5df23ae37193784811b6b.camel@novalis.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <672a6fb9e480becbfcb5df23ae37193784811b6b.camel@novalis.org> Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP David Turner wrote: > Let's try this version. Thanks! Tested-by: Eric Wong Not sure if t1512 would be the best place to put the test, but having a repo with ambiguous data already at hand was easiest. ---------8<------- Subject: [PATCH] t1512: test ambiguous cat-file --batch and --batch-output Test the new "ambiguous" result from cat-file --batch and --batch-check. This is in t1512 instead of t1006 since we need a repo with ambiguous object_id names. Signed-off-by: Eric Wong --- t/t1512-rev-parse-disambiguation.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/t/t1512-rev-parse-disambiguation.sh b/t/t1512-rev-parse-disambiguation.sh index e4d5b56014..b0819630c9 100755 --- a/t/t1512-rev-parse-disambiguation.sh +++ b/t/t1512-rev-parse-disambiguation.sh @@ -388,4 +388,14 @@ test_expect_success C_LOCALE_OUTPUT 'ambiguous commits are printed by type first done ' +test_expect_success 'cat-file --batch and --batch-check show ambiguous' ' + echo "0000 ambiguous" >expect && + echo 0000 | git cat-file --batch-check >actual 2>err && + test_cmp expect actual && + grep hint: err && + echo 0000 | git cat-file --batch >actual 2>err && + test_cmp expect actual && + grep hint: err +' + test_done