Skip to content

pr-2288/poojarysrujith/microproject-git-libification-v5

tagged this 04 Nov 03:43
From: Srujith A Poojary <poojarysrujith@gmail.com>

The commit IDs shown in a submodule diff header belong to the
submodule's object database. However, strbuf_add_unique_abbrev()
uses the_repository, so it checks the superproject's object
database when abbreviating those IDs.

Use the submodule repository when it is available, and fall back
to the repository from the diff options when it is not.

The expected abbreviation for a submodule commit depends on the
repository's hash algorithm. Use test_oid_cache to provide the
expected value for each algorithm and remove the SHA1 prerequisite
so this test runs with both SHA-1 and SHA-256.

Signed-off-by: Srujith A Poojary <poojarysrujith@gmail.com>

Submitted-As: https://lore.kernel.org/git/pull.2288.v5.git.1793763781129.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2288.git.1793435149942.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2288.v2.git.1793473062113.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2288.v3.git.1793474657981.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.2288.v4.git.1793648430.gitgitgadget@gmail.com
Assets 2
Loading