From patchwork Tue Feb 12 01:22:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "brian m. carlson" X-Patchwork-Id: 10807141 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 1063513A4 for ; Tue, 12 Feb 2019 01:23:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 01B2B2AC25 for ; Tue, 12 Feb 2019 01:23:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EA14E2AC31; Tue, 12 Feb 2019 01:23:36 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 9EC582AC25 for ; Tue, 12 Feb 2019 01:23:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727188AbfBLBXe (ORCPT ); Mon, 11 Feb 2019 20:23:34 -0500 Received: from injection.crustytoothpaste.net ([192.241.140.119]:34316 "EHLO injection.crustytoothpaste.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727168AbfBLBXd (ORCPT ); Mon, 11 Feb 2019 20:23:33 -0500 Received: from genre.crustytoothpaste.net (unknown [IPv6:2001:470:b978:101:3dc7:72ec:75fa:fee5]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by injection.crustytoothpaste.net (Postfix) with ESMTPSA id 0CFBD60E54; Tue, 12 Feb 2019 01:23:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net; s=default; t=1549934612; bh=+5fh+FR9PRQDRolK2uH6wkevzO/rfiLlvMVrulPvglI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Reply-To: Subject:Date:To:CC:Resent-Date:Resent-From:Resent-To:Resent-Cc: In-Reply-To:References:Content-Type:Content-Disposition; b=SE8yK/ISp0FxOKocWl30aadQDr6to/YQemn0VwtFwkvbTF0VGq8TNxX4qUvcEK9Ql DKqMojUCGGsYyAxV5ixysKacutxwIde7bNCFJJk6RKq18rPrPlfiVsXNcJO7qTxCGH /J+Rx+w987HOZonP/Kv+Oa+4fgSJ9ovtPoHvlA+zlUTPDRv+X31LCwdQDd4VV4KIzt Bwv4KOV92Yu2fhNML4FcrsWSwHHgutT74kSGQGREbKH0ZlsZQWDamcP+7zZfE/WZOK 9cAEy8ckeFn1+0uhkZvFtz2lF0Ne8Gnj24U22VnHXlDq8ifYaeeXDu2fBnohhF+X+t sui6u/3wEB77iy8AWJXApKbtcOxqzIjGCdyXB4UzNmt3yDIqxZhAZLxY/FvpVziKyi edn6J6z2pHsYvzcQrnGy0LI5XIrFp+rdYo6RFdf6uJ62QsKxvDYRiA1u+v3VUPv45c k3BFd4jFMw2SKBnmVz1zLdoRpI2p/h8oRDGC1tbiZSL0kcJddkk From: "brian m. carlson" To: Cc: =?utf-8?q?Ren=C3=A9_Scharfe?= , Duy Nguyen Subject: [PATCH 17/31] http-backend: allow 64-character hex names Date: Tue, 12 Feb 2019 01:22:42 +0000 Message-Id: <20190212012256.1005924-18-sandals@crustytoothpaste.net> X-Mailer: git-send-email 2.20.1.791.gb4d0f1c61a In-Reply-To: <20190212012256.1005924-1-sandals@crustytoothpaste.net> References: <20190212012256.1005924-1-sandals@crustytoothpaste.net> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 127.0.1.1 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In an SHA-256-backed repository using the http-backend handler for dumb protocol clients, it may be necessary to access the raw packs using their full SHA-256-specified names. Allow packs and loose objects to be accessed using their full SHA-256-specified 64-character hex names. Signed-off-by: brian m. carlson --- http-backend.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/http-backend.c b/http-backend.c index 29e68e38b5..ec3144b444 100644 --- a/http-backend.c +++ b/http-backend.c @@ -711,8 +711,11 @@ static struct service_cmd { {"GET", "/objects/info/http-alternates$", get_text_file}, {"GET", "/objects/info/packs$", get_info_packs}, {"GET", "/objects/[0-9a-f]{2}/[0-9a-f]{38}$", get_loose_object}, + {"GET", "/objects/[0-9a-f]{2}/[0-9a-f]{62}$", get_loose_object}, {"GET", "/objects/pack/pack-[0-9a-f]{40}\\.pack$", get_pack_file}, + {"GET", "/objects/pack/pack-[0-9a-f]{64}\\.pack$", get_pack_file}, {"GET", "/objects/pack/pack-[0-9a-f]{40}\\.idx$", get_idx_file}, + {"GET", "/objects/pack/pack-[0-9a-f]{64}\\.idx$", get_idx_file}, {"POST", "/git-upload-pack$", service_rpc}, {"POST", "/git-receive-pack$", service_rpc}