Re: [PATCH 3/8] fetch: fix missing from-reference when fetching HEAD:foo
- From
Jacob Keller <jacob.e.keller@intel.com>
- Date
- Apr 26, 2023, 19:21 UTC
- Message-ID
- <36931566-1258-c5de-2efb-63541a2ce96c@intel.com>
- In-Reply-To
- <596e12f03a296d753ee6fe8face9522edc9e397e.1681906948.git.ps@pks.im>
On 4/19/2023 5:31 AM, Patrick Steinhardt wrote:
Show 20 quoted lines
> > +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.
Thanks, Jake