From: Patrick Steinhardt Date: Thu, 27 Apr 2023 10:58:38 GMT Subject: Re: [PATCH 3/8] fetch: fix missing from-reference when fetching HEAD:foo Message-ID: In-Reply-To: <36931566-1258-c5de-2efb-63541a2ce96c@intel.com> On Wed, Apr 26, 2023 at 12:21:40PM -0700, Jacob Keller wrote: > > > On 4/19/2023 5:31 AM, Patrick Steinhardt wrote: > > > > +test_expect_success 'fetch output with HEAD and --dry-run' ' > > + test_when_finished "rm -rf head" && > > + git clone . head && > > + > > + git -C head fetch --dry-run origin HEAD >actual 2>&1 && > > + cat >expect <<-EOF && > > + From $(test-tool path-utils real_path .)/. > > + * branch HEAD -> FETCH_HEAD > > + EOF > > + test_cmp expect actual && > > + > > + git -C head fetch --dry-run origin HEAD:foo >actual 2>&1 && > > + cat >expect <<-EOF && > > + From $(test-tool path-utils real_path .)/. > > + * [new ref] HEAD -> foo > > + EOF > > + test_cmp expect actual > > +' > > + > > The test mentions HEAD and --dry-run, but the bug seems to exist > regardless of whether --dry-run is used. I understand the use of > --dry-run for testing fetch output so that you can repeatably run git > fetch and get the same results. > > The tests here should probably also have a test that covers fetch > without --dry-run though. Makes sense, will amend! Patrick