From patchwork Thu May 26 21:47:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Hostetler X-Patchwork-Id: 12862842 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E06F3C433FE for ; Thu, 26 May 2022 21:49:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349303AbiEZVtq (ORCPT ); Thu, 26 May 2022 17:49:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349215AbiEZVtc (ORCPT ); Thu, 26 May 2022 17:49:32 -0400 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E572E8B8E for ; Thu, 26 May 2022 14:49:18 -0700 (PDT) Received: by mail-wm1-x32f.google.com with SMTP id 7so528512wmz.3 for ; Thu, 26 May 2022 14:49:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=JW5/RT2bZpq4NBqwKIrDN6AyPlqs0iGhc4xOjJM6ksI=; b=D1qzqlsLDg4HqNOYCnoR2bRHqlf1D5gYDHfeSFKfDv6Dufw747iOG/uwrAm2BlA5zY olyHkYwQrUkCC/0JXI+Bz8P+YC9+eWUpp1ffmvWr4gv+19J+sjYPszYDkBaEbaJdaLJL E6wrfraUTnclKsYSgiAy/7LNmZSN/0zxcWSArHOb4gpqqEq7a/Z4Fr5F11A1yKu5VngO WXdJc9KAwWyotInRmN2b051HmkPrfr1iuzOyKLt95asX6RDjndFAdkYXgJbG2NFdmtlh bkqC6FXew4Yq+7EAxPzpXCeNAK6AT4EMQL+K+oQmjGtu/dIEgXsGkxJ7YcYnFBhjU0sP 3F5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=JW5/RT2bZpq4NBqwKIrDN6AyPlqs0iGhc4xOjJM6ksI=; b=hIbuVVqSfVqbw3xUJqFiLtYnhyWhpI/8wIDibRoyeRuH/tkV4jYo4XXrPGkIAM1UFl Kz9mY9/qP2GVz2QirklEP+CcxjxtMJ3YEilVOK+ZBZTDa73AsC/zkhaKHoipZXhl8HmQ kloFMY5FtbF3orf/0lMDfA79DXEQ1DsTwBi8ooHEdpFXWUcNsGsK920Pqs0T+h5+S3Ey +Inmg1GhJUmjIM2XDXr60ssy1OM0ImwmXtVofkOyBpeC6T2oH7h01Ve+9ENupeV6OPIl qiY2EDsCsbxn2AVeq7uNj835lCvKYKvc0arvThzUXhkBCTJeL66G5ESz5RwfG28my+MY Y3GQ== X-Gm-Message-State: AOAM531gvzwwKTCyCQOThneI/WEZAnhT0B5rNKd//YQuSNkuRwfnuaDy 4gIaIogJyyjcVqGNQ2WuoX6V4kJdhCg= X-Google-Smtp-Source: ABdhPJx6jWLHTIxyZwvA7skdRIW3ze8tPppHFmxWwUc4+SCwaypPTGHqBGssbogT+ohUJ6Y/FaiZrg== X-Received: by 2002:a7b:c187:0:b0:397:611b:2619 with SMTP id y7-20020a7bc187000000b00397611b2619mr4112640wmi.71.1653601756542; Thu, 26 May 2022 14:49:16 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id az26-20020a05600c601a00b003942a244edfsm266502wmb.36.2022.05.26.14.49.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 May 2022 14:49:16 -0700 (PDT) Message-Id: <27f360b33364d997ee7e31b0b0c6704fad088616.1653601644.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Thu, 26 May 2022 21:47:05 +0000 Subject: [PATCH v9 11/30] unpack-trees: initialize fsmonitor_has_run_once in o->result Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Jeff Hostetler , Derrick Stolee , =?utf-8?b?w4Z2YXIgQXJuZmrDtnI=?= =?utf-8?b?w7A=?= Bjarmason , Torsten =?unknown-8bit?q?B?= =?unknown-8bit?q?=C3=B6gershausen?= , rsbecker@nexbridge.com, Bagas Sanjaya , Johannes Schindelin , Jeff Hostetler , Jeff Hostetler Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Jeff Hostetler From: Jeff Hostetler Initialize `o->result.fsmonitor_has_run_once` based upon value in `o->src_index->fsmonitor_has_run_once` to prevent a second fsmonitor query during the tree traversal and possibly getting a skewed view of the working directory. The checkout code has already talked to the fsmonitor and the traversal is updating the index as it traverses, so there is no need to query the fsmonitor. Signed-off-by: Jeff Hostetler --- unpack-trees.c | 1 + 1 file changed, 1 insertion(+) diff --git a/unpack-trees.c b/unpack-trees.c index 360844bda3a..888cff81f9c 100644 --- a/unpack-trees.c +++ b/unpack-trees.c @@ -1772,6 +1772,7 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options o->result.fsmonitor_last_update = xstrdup_or_null(o->src_index->fsmonitor_last_update); + o->result.fsmonitor_has_run_once = o->src_index->fsmonitor_has_run_once; /* * Sparse checkout loop #1: set NEW_SKIP_WORKTREE on existing entries