]> git.ipfire.org Git - thirdparty/git.git/commit
t6020: test for duplicate refnames in bundle creation
authorKarthik Nayak <karthik.188@gmail.com>
Tue, 8 Apr 2025 09:00:52 +0000 (11:00 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 8 Apr 2025 21:21:49 +0000 (14:21 -0700)
commit09d86e0bb5159a767b97ec2e319ab49f1d9f28b3
tree6729e4df2c2fb2a14049d574bcff895d14df0cc4
parent485f5f863615e670fd97ae40af744e14072cfe18
t6020: test for duplicate refnames in bundle creation

The commit b2a6d1c686 (bundle: allow the same ref to be given more than
once, 2009-01-17) added functionality to detect and remove duplicate
refnames from being added during bundle creation. This ensured that
clones created from such bundles wouldn't barf about duplicate refnames.

The following commit will add some optimizations to make this check
faster, but before doing that, it would be optimal to add tests to
capture the current behavior.

Add tests to capture duplicate refnames provided by the user during
bundle creation. This can be a combination of:

  - refnames directly provided by the user.
  - refname duplicate by using the '--all' flag alongside manual
    references being provided.
  - exclusion criteria provided via a refname "main^!".
  - short forms of refnames provided, "main" vs "refs/heads/main".

Note that currently duplicates due to usage of short and long forms goes
undetected. This should be fixed with the optimizations made in the next
commit.

Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t6020-bundle-misc.sh