mirror of
https://github.com/git/git.git
synced 2026-03-13 02:13:24 +01:00
sha1_name.c: add support for disambiguating other types
This teaches the revision parser that in "$name:$path" (used for a blob object name), "$name" must be a tree-ish. There are many more places where we know what types of objects are called for. This patch adds support for "commit", "treeish", "tree", and "blob", which could be used in the following contexts: - "git apply --build-fake-ancestor" reads the "index" lines from the patch; they must name blob objects (not even "blob-ish"); - "git commit-tree" reads a tree object name (not "tree-ish"), and zero or more commit object names (not "committish"); - "git reset $rev" wants a committish; "git reset $rev -- $path" wants a treeish. They will come in later patches in the series. Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
@@ -45,7 +45,7 @@ test_expect_success 'warn ambiguity when no candidate matches type hint' '
|
||||
grep "short SHA1 000000000 is ambiguous" actual
|
||||
'
|
||||
|
||||
test_expect_failure 'disambiguate tree-ish' '
|
||||
test_expect_success 'disambiguate tree-ish' '
|
||||
# feed tree-ish in an unambiguous way
|
||||
git rev-parse --verify 0000000000cdc:a0blgqsjc &&
|
||||
|
||||
|
||||
Reference in New Issue
Block a user