Re: [PATCH v2 5/5] maintenance: allow custom refspecs during prefetch
- From
- Jonathan Tan <jonathantanmy@google.com>
- Date
- Apr 8, 2021, 00:23 UTC
- Message-ID
- <20210408002353.2467818-1-jonathantanmy@google.com>
- In-Reply-To
- <9592224e3d428762c6f9b38a0bcc2cee5c3dff6c.1617734871.git.gitgitgadget@gmail.com>
Show 13 quoted lines
> +test_expect_success 'prefetch custom refspecs' ' > + git -C clone1 branch -f special/fetched HEAD && > + git -C clone1 branch -f special/secret/not-fetched HEAD && > + > + # create multiple refspecs for remote1 > + git config --add remote.remote1.fetch "+refs/heads/special/fetched:refs/heads/fetched" && > + git config --add remote.remote1.fetch "^refs/heads/special/secret/not-fetched" && > + > + GIT_TRACE2_EVENT="$(pwd)/prefetch-refspec.txt" git maintenance run --task=prefetch 2>/dev/null && > + > + fetchargs="--prune --no-tags --no-write-fetch-head --recurse-submodules=no --refmap= --quiet" && > + > + # skips second refspec because it is not a pattern type
What second refspec is being skipped?
Show 6 quoted lines
> + rs1="+refs/heads/*:refs/prefetch/remotes/remote1/*" && > + rs2="+refs/heads/special/fetched:refs/prefetch/heads/fetched" && > + rs3="^refs/heads/special/secret/not-fetched" && > + > + test_subcommand git fetch remote1 $fetchargs "$rs1" "$rs2" "$rs3" <prefetch-refspec.txt && > + test_subcommand git fetch remote2 $fetchargs "+refs/heads/*:refs/prefetch/remotes/remote2/*" <prefetch-refspec.txt &&
How is this command generated? I don't see any mention of remote2 in this test. (If it's because this repo was configured in a previous test and some of the configuration carried over, I think it's best to start in a new repo or at least have the previous config be cleared.)
Show 11 quoted lines
> + > + # first refspec is overridden by second > + test_must_fail git rev-parse refs/prefetch/special/fetched && > + git rev-parse refs/prefetch/heads/fetched && > + > + # possible incorrect places for the non-fetched ref > + test_must_fail git rev-parse refs/prefetch/remotes/remote1/secret/not-fetched && > + test_must_fail git rev-parse refs/prefetch/remotes/remote1/not-fetched && > + test_must_fail git rev-parse refs/heads/secret/not-fetched && > + test_must_fail git rev-parse refs/heads/not-fetched > +'
Other than this and the other comments that others have brought up, this series looks good.