Merge branch 'jc/sha1-name-object-peeler'
There was no good way to ask "I have a random string that came from outside world. I want to turn it into a 40-hex object name while making sure such an object exists". A new peeling suffix ^{object} can be used for that purpose, together with "rev-parse --verify". * jc/sha1-name-object-peeler: peel_onion(): teach $foo^{object} peeler peel_onion: disambiguate to favor tree-ish when we know we want a tree-ish
This commit is contained in:
@ -116,6 +116,11 @@ some output processing may assume ref names in UTF-8.
|
||||
object of that type is found or the object cannot be
|
||||
dereferenced anymore (in which case, barf). '<rev>{caret}0'
|
||||
is a short-hand for '<rev>{caret}\{commit\}'.
|
||||
+
|
||||
'rev{caret}\{object\}' can be used to make sure 'rev' names an
|
||||
object that exists, without requiring 'rev' to be a tag, and
|
||||
without dereferencing 'rev'; because a tag is already an object,
|
||||
it does not have to be dereferenced even once to get to an object.
|
||||
|
||||
'<rev>{caret}\{\}', e.g. 'v0.99.8{caret}\{\}'::
|
||||
A suffix '{caret}' followed by an empty brace pair
|
||||
|
Reference in New Issue
Block a user