From patchwork Fri Nov 27 07:50:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sunshine X-Patchwork-Id: 11935135 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7C8B2C2D0E4 for ; Fri, 27 Nov 2020 07:51:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0FE9A21D93 for ; Fri, 27 Nov 2020 07:51:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NRP3QOcX" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392786AbgK0Hvx (ORCPT ); Fri, 27 Nov 2020 02:51:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392782AbgK0Hvw (ORCPT ); Fri, 27 Nov 2020 02:51:52 -0500 Received: from mail-il1-x141.google.com (mail-il1-x141.google.com [IPv6:2607:f8b0:4864:20::141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E502C0613D4 for ; Thu, 26 Nov 2020 23:51:52 -0800 (PST) Received: by mail-il1-x141.google.com with SMTP id f5so3818416ilj.9 for ; Thu, 26 Nov 2020 23:51:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3N8OmOQFNx6Z25QLFPQLON+DSEIPCgbfupV+r8IndRg=; b=NRP3QOcXel13FewljO+uHJHWpEcEaTCRQ03f/dnP9dqU2Y92nrEXfIcUQXwxokpOYN wDagWYE6ajwSfRCQ1uPxuq3yWMxu/Me4Lc5lava2WvmMwdPcwiuNrMtDgrpX6VFqzHBi vyWsMo7/1C9p3C2suJ9kT6hsZAb7+k6ygmMNUFBxZ1I2EBxUJ2HpbSRJavQNEdZthnjW KyYKV8rL++OWdCvCCnt0mjPvhJJi29b6UIBkvkP0tA7/pLrbO+wvPLdNNrX271+UxXa6 cbB4uCQ2c3GH6OHHLoxk72Pd/XfplyFDlzeOehrKB8yyYau84ynta84HDyYZeW782stY eM/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=3N8OmOQFNx6Z25QLFPQLON+DSEIPCgbfupV+r8IndRg=; b=sp3MuaqUkEiCJ85nR7eFoFpHaoj57LNa20moOlVT4IiQ2X8P4xeNGLHkPSdwRnXO9o wjd+cw3px/mqlm34K+CtkeF9av4L3DpdCh9kZ+Xczb3Rfk6GByglFP17AUdU5FPiz4oW EK2tBYM+mWt/aSuZziOlw+JnGLkO0Q6Zp4X7OqhsR6y52eZw8Ylvz2zzwLjgg2ihHwe1 inYPgiRYHLe1yIv1gwm0tsYt63AwOEDl7HND33/RHmzJ0c0VY5fnpyRqJ54As0/eu8RJ /wicJ5lOIqZfeyNj8Wq0vGZI8dsoU8pTixqr0AC+jbgLrvmz2s9UhfoC4llnOY73uSft ZTdA== X-Gm-Message-State: AOAM530dxyuTVInkBfBGgkKfqFWcrPZ4NnkFG/s59Ix6PwwUYA59O0Cs bddF+kOtq3PsqOcNRTNjowCoI1jQ2Jk= X-Google-Smtp-Source: ABdhPJxnAxXTz2mpET/SiQoxfROV/HgqWUvqMfkAsiKdLef8z9hGCNqyUo+jZshFI5LmT5Ex/s1s9Q== X-Received: by 2002:a92:2a01:: with SMTP id r1mr5912920ile.22.1606463511372; Thu, 26 Nov 2020 23:51:51 -0800 (PST) Received: from localhost.localdomain (user-12l2dpj.cable.mindspring.com. [69.81.55.51]) by smtp.gmail.com with ESMTPSA id 10sm4652447ill.75.2020.11.26.23.51.50 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Nov 2020 23:51:50 -0800 (PST) Sender: Eric Sunshine From: Eric Sunshine To: git@vger.kernel.org Cc: Derrick Stolee , Eric Sunshine Subject: [PATCH 1/3] t7900: fix test failures when invoked individually via --run Date: Fri, 27 Nov 2020 02:50:52 -0500 Message-Id: <20201127075054.31174-2-sunshine@sunshineco.com> X-Mailer: git-send-email 2.29.2.576.ga3fc446d84 In-Reply-To: <20201127075054.31174-1-sunshine@sunshineco.com> References: <20201127075054.31174-1-sunshine@sunshineco.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org A couple tests use `rm expect` to remove a file created by earlier tests. The presence of this file is immaterial at the point the attempt is made to remove it, yet if it doesn't exist, the test fails unnecessarily. One case in which the file may validly not exist is when --run or GIT_SKIP_TESTS is used to selectively run particular tests. Fix these pointless failures. Signed-off-by: Eric Sunshine --- t/t7900-maintenance.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/t/t7900-maintenance.sh b/t/t7900-maintenance.sh index 0246e4ce30..ef3aec3253 100755 --- a/t/t7900-maintenance.sh +++ b/t/t7900-maintenance.sh @@ -429,7 +429,7 @@ test_expect_success !MINGW 'start and stop macOS maintenance' ' EOF test_cmp expect actual && - rm expect && + rm -f expect && for frequency in hourly daily weekly do PLIST="$HOME/Library/LaunchAgents/org.git-scm.git.$frequency.plist" && @@ -491,7 +491,6 @@ test_expect_success 'start and stop Windows maintenance' ' # stop does not unregister the repo git config --get --global maintenance.repo "$(pwd)" && - rm expect && printf "/delete /tn Git Maintenance (%s) /f\n" \ hourly daily weekly >expect && test_cmp expect args From patchwork Fri Nov 27 07:50:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sunshine X-Patchwork-Id: 11935137 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 513E2C63777 for ; Fri, 27 Nov 2020 07:51:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D9C2C21D93 for ; Fri, 27 Nov 2020 07:51:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FvJ66EU5" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392792AbgK0Hvy (ORCPT ); Fri, 27 Nov 2020 02:51:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392782AbgK0Hvx (ORCPT ); Fri, 27 Nov 2020 02:51:53 -0500 Received: from mail-io1-xd41.google.com (mail-io1-xd41.google.com [IPv6:2607:f8b0:4864:20::d41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47BFAC0613D1 for ; Thu, 26 Nov 2020 23:51:53 -0800 (PST) Received: by mail-io1-xd41.google.com with SMTP id y5so2894258iow.5 for ; Thu, 26 Nov 2020 23:51:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bp74vNjR3dZr5ilueZMUEgGapE5gBgheszf1OlmAx0g=; b=FvJ66EU5wpS3YXjzeJp+YL8wnEshOj396ePhmgtF6DMyeyRR34j9yI+bxgn70WeXp5 SxLcKRmwdzXEHOKsEHtvuukaikMaeuyGysppMTYG1BhINpJH3eBFR2s5lxBzlrQUdqVj IQjy3oTJ1y5BM1D8Cm4nj+GLGl7sx0EZyCas2IucbNw6IUd9bIy/l3Dw4/lLw7KcIOmq oK9F+iuNfkZ7Rfj9CIeU41E30zeIVVP8lV3C0DFe125UMHyShDP2K3cwXQC/WPnGpuqs oZUxIKaJ2MRKyVWfsAGscUNuJI4LZpQ6jsaXRxFthu9zkeottDvP0eqoL5NI+nFt5tac YvCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=bp74vNjR3dZr5ilueZMUEgGapE5gBgheszf1OlmAx0g=; b=X4GjQQ/GfkEkRPsSISxx7dxKrcDM7LMxb1Wj9bnwFjw2/oLlu2j/x09wO7BnrX27Jz ce2Fwd8vp6ghBpX0/HlBTahvjy0Aqkha6eOtkMBRB92Xk/FFrDP3wctFBTZBXc2IqiBF 0zET+iCQnXETceSK+CKg9Nk5wWgb8pDddaZhE7WFo6F4ddPSLPPZ+CY5cB9XmGbQEaN8 L3o8x084HKujdMtUi4xD71lEFFb44xqqBrKhx1Fx1gBSmiQsogPbhBVZKcIX0QBeEQVy yWWdd5jHVw9bzmJOIcvO2v3rMTqvkldJ/belp/7j7w5PZKoHhZ6TxNfZnBCIl4g86hif 3FZA== X-Gm-Message-State: AOAM533WhvDz5WpkVvvriYCW6C1c/Z1fn3gRLOYkOwItKM+Wxq+bF3ZV mdbWYX/iU0LDqMDMh+5ouotjUA2wG9I= X-Google-Smtp-Source: ABdhPJxjG9/8WPe8Y24v8m57Ot5EH/599oFkPktL4Ghwp4m0RCSZ+TPdUInXNoNqGgPAeqBCKK2hMw== X-Received: by 2002:a05:6602:29cf:: with SMTP id z15mr5232101ioq.39.1606463512334; Thu, 26 Nov 2020 23:51:52 -0800 (PST) Received: from localhost.localdomain (user-12l2dpj.cable.mindspring.com. [69.81.55.51]) by smtp.gmail.com with ESMTPSA id 10sm4652447ill.75.2020.11.26.23.51.51 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Nov 2020 23:51:51 -0800 (PST) Sender: Eric Sunshine From: Eric Sunshine To: git@vger.kernel.org Cc: Derrick Stolee , Eric Sunshine Subject: [PATCH 2/3] test-tool: add `getuid` subcommand Date: Fri, 27 Nov 2020 02:50:53 -0500 Message-Id: <20201127075054.31174-3-sunshine@sunshineco.com> X-Mailer: git-send-email 2.29.2.576.ga3fc446d84 In-Reply-To: <20201127075054.31174-1-sunshine@sunshineco.com> References: <20201127075054.31174-1-sunshine@sunshineco.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org It is difficult, if not impossible, for a test to obtain the user ID in a portable fashion on all platforms and be guaranteed that it is the same user ID Git itself sees when invoking getuid(). This is especially true on Microsoft Windows for which getuid() in C code and $(id -u) in a shell script may return entirely different values. Sidestep this problem by adding a `getuid` subcommand to test-tool which is guaranteed to provide tests with the same value as getuid() returns in Git code. Signed-off-by: Eric Sunshine --- Makefile | 1 + t/helper/test-getuid.c | 7 +++++++ t/helper/test-tool.c | 1 + t/helper/test-tool.h | 1 + 4 files changed, 10 insertions(+) create mode 100644 t/helper/test-getuid.c diff --git a/Makefile b/Makefile index c39b39bd7d..a5c38aad5e 100644 --- a/Makefile +++ b/Makefile @@ -703,6 +703,7 @@ TEST_BUILTINS_OBJS += test-dump-untracked-cache.o TEST_BUILTINS_OBJS += test-example-decorate.o TEST_BUILTINS_OBJS += test-genrandom.o TEST_BUILTINS_OBJS += test-genzeros.o +TEST_BUILTINS_OBJS += test-getuid.o TEST_BUILTINS_OBJS += test-hash-speed.o TEST_BUILTINS_OBJS += test-hash.o TEST_BUILTINS_OBJS += test-hashmap.o diff --git a/t/helper/test-getuid.c b/t/helper/test-getuid.c new file mode 100644 index 0000000000..d741302461 --- /dev/null +++ b/t/helper/test-getuid.c @@ -0,0 +1,7 @@ +#include "test-tool.h" + +int cmd__getuid(int argc, const char **argv) +{ + printf("%d\n", getuid()); + return 0; +} diff --git a/t/helper/test-tool.c b/t/helper/test-tool.c index 432b49d948..ad5f681e68 100644 --- a/t/helper/test-tool.c +++ b/t/helper/test-tool.c @@ -31,6 +31,7 @@ static struct test_cmd cmds[] = { { "example-decorate", cmd__example_decorate }, { "genrandom", cmd__genrandom }, { "genzeros", cmd__genzeros }, + { "getuid", cmd__getuid }, { "hashmap", cmd__hashmap }, { "hash-speed", cmd__hash_speed }, { "index-version", cmd__index_version }, diff --git a/t/helper/test-tool.h b/t/helper/test-tool.h index 7c3281e071..765976e1eb 100644 --- a/t/helper/test-tool.h +++ b/t/helper/test-tool.h @@ -21,6 +21,7 @@ int cmd__dump_untracked_cache(int argc, const char **argv); int cmd__example_decorate(int argc, const char **argv); int cmd__genrandom(int argc, const char **argv); int cmd__genzeros(int argc, const char **argv); +int cmd__getuid(int argc, const char **argv); int cmd__hashmap(int argc, const char **argv); int cmd__hash_speed(int argc, const char **argv); int cmd__index_version(int argc, const char **argv); From patchwork Fri Nov 27 07:50:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sunshine X-Patchwork-Id: 11935139 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1208C64E7A for ; Fri, 27 Nov 2020 07:51:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7E61021D93 for ; Fri, 27 Nov 2020 07:51:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="C7QgEeN7" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392795AbgK0Hvz (ORCPT ); Fri, 27 Nov 2020 02:51:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392782AbgK0Hvy (ORCPT ); Fri, 27 Nov 2020 02:51:54 -0500 Received: from mail-io1-xd41.google.com (mail-io1-xd41.google.com [IPv6:2607:f8b0:4864:20::d41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58549C0613D1 for ; Thu, 26 Nov 2020 23:51:54 -0800 (PST) Received: by mail-io1-xd41.google.com with SMTP id d8so2776389ioc.13 for ; Thu, 26 Nov 2020 23:51:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wNhiXpAvChUo67W1GqCsOYvZ7qzYIPgcZa6uJQ3FIIQ=; b=C7QgEeN7++XnU6L0cYD5Of+dQsZKkh7dwTMkp1Lo0ZtiiPt1y+npbgg5EGMC3E+9NT +zbm85SadE24IIrj1zbBOQhXASXszipBn21/TcR5PUIqCMjzVCAtgipChbbh0T4cjqqO IdxG7TlKUm2Y/Vizs2PFP3zV40GNtMVymYDn1t5m+NX13CcpKy4CLMr0uXSX4ktVVmX5 LcEv3HKk0VwYPSd9lqUxjhGwGOwRp8GHK9q2JtlCoAAh+GEiyTySiqQfx4VOYUQPgGxX QqzkfgQkuHtdk3AMVuzJQN76vP48/f6hjI5p6J6TGPLQ1wRffpMEBHjcE939d13StLu2 iStg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=wNhiXpAvChUo67W1GqCsOYvZ7qzYIPgcZa6uJQ3FIIQ=; b=leBPyR7Ey0EZND9lQwN1q54qYEgQ/ghLWoHhb2ceeeGYE71Swo0/Aw+SXkxvrP1Zbl avZvU1m4nOS2OD4xccTei+ItbTuLX0hdPIznZsyK46h875XWTF8MmjRZgg3UFubzQDir MyA8tPUrWO9f2ktvv5v9GFWedHjSOs+I0Mt0GfVbsnlOf+iZXsdCKk2zpZMGCwmgsQy0 NnYc3el33Sol0+Ohe5klLEsDZq43HpcVptx+mHxRX9Cygj+V/N+2KQMvCQd6DCWk0Ml7 EODEHhePyTHuXpq6Urk+TTDzTT+EI0EUwK/SQrft7iND9WDU6huxIUZU2g5Ga/YscWF0 rSvg== X-Gm-Message-State: AOAM531K45+iiwo8sMlgS2q4k/Db7xcxt+kg3YXuiQrm9l5VsHzMON8f +5d02F/chL2viCehdQBLW2sIvKVvAqE= X-Google-Smtp-Source: ABdhPJwTViKLO/Gpgrd+kd3Y6bO57R//5fv4BpZWZWkU62TkLhH1F6xcZqgQEJzw+4cVEFEv1tPaMw== X-Received: by 2002:a05:6638:15a:: with SMTP id y26mr6415642jao.57.1606463513381; Thu, 26 Nov 2020 23:51:53 -0800 (PST) Received: from localhost.localdomain (user-12l2dpj.cable.mindspring.com. [69.81.55.51]) by smtp.gmail.com with ESMTPSA id 10sm4652447ill.75.2020.11.26.23.51.52 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Nov 2020 23:51:52 -0800 (PST) Sender: Eric Sunshine From: Eric Sunshine To: git@vger.kernel.org Cc: Derrick Stolee , Eric Sunshine Subject: [PATCH 3/3] t7900: make macOS-specific test work on Windows Date: Fri, 27 Nov 2020 02:50:54 -0500 Message-Id: <20201127075054.31174-4-sunshine@sunshineco.com> X-Mailer: git-send-email 2.29.2.576.ga3fc446d84 In-Reply-To: <20201127075054.31174-1-sunshine@sunshineco.com> References: <20201127075054.31174-1-sunshine@sunshineco.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Although `git maintenance start` and `git maintenance stop` necessarily invoke platform-specific scheduling utilities, their related tests have been carefully crafted -- with one minor exception -- to work correctly on any platform, thus improving overall coverage. The exception is that the macOS-specific test fails on Windows due to unportable use of `$(id -u)` and comparison involving the value of $HOME which suffers from the typical shortcoming on that platform in which the same path may be represented two different ways depending upon its source (i.e. as a Windows path `C:/git-sdk-64/usr/src/git/foo` versus as a Unix path `/usr/src/git/foo`). Fix both problems and drop the !MINGW prerequisite from the macOS-specific test, thus allowing the test to run on Windows, as well. Signed-off-by: Eric Sunshine --- t/t7900-maintenance.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/t/t7900-maintenance.sh b/t/t7900-maintenance.sh index ef3aec3253..500eaae4fd 100755 --- a/t/t7900-maintenance.sh +++ b/t/t7900-maintenance.sh @@ -408,8 +408,10 @@ test_expect_success 'start preserves existing schedule' ' grep "Important information!" cron.txt ' -test_expect_success !MINGW 'start and stop macOS maintenance' ' - uid=$(id -u) && +test_expect_success 'start and stop macOS maintenance' ' + uid=$(test-tool getuid) && + # ensure $HOME can be compared against hook arguments on all platforms + pfx=$(cd "$HOME" && pwd) && write_script print-args <<-\EOF && echo $* >>args @@ -432,7 +434,7 @@ test_expect_success !MINGW 'start and stop macOS maintenance' ' rm -f expect && for frequency in hourly daily weekly do - PLIST="$HOME/Library/LaunchAgents/org.git-scm.git.$frequency.plist" && + PLIST="$pfx/Library/LaunchAgents/org.git-scm.git.$frequency.plist" && test_xmllint "$PLIST" && grep schedule=$frequency "$PLIST" && echo "bootout gui/$uid $PLIST" >>expect && @@ -446,7 +448,7 @@ test_expect_success !MINGW 'start and stop macOS maintenance' ' # stop does not unregister the repo git config --get --global maintenance.repo "$(pwd)" && - printf "bootout gui/$uid $HOME/Library/LaunchAgents/org.git-scm.git.%s.plist\n" \ + printf "bootout gui/$uid $pfx/Library/LaunchAgents/org.git-scm.git.%s.plist\n" \ hourly daily weekly >expect && test_cmp expect args && ls "$HOME/Library/LaunchAgents" >actual &&