Obsolete GitObjectType#417
Conversation
There was a problem hiding this comment.
Perhaps insert an Unknown or similar value at 0 and shift the rest?
There was a problem hiding this comment.
Also, perhaps GitLink to align with the type?
There was a problem hiding this comment.
Perhaps insert an
Unknownor similar value at 0 and shift the rest?
I may be missing something, but I can't think of a use case where this would be needed.
- When building a
TreeDefinition, the user should know what's the type ofTreeEntryDefinitionhe's adding - When reading an existing
Tree, the parser should always be able to pick among the known values
At least, I hope so. Help?
There was a problem hiding this comment.
It's not so much that it would be used, but having default(TreeEntryTargetType) be GitLink feels wrong. Maybe skip a named default member, but start the values at 1?
There was a problem hiding this comment.
Also, perhaps
GitLinkto align with the type?
Fixed!
There was a problem hiding this comment.
It's not so much that it would be used, but having
default(TreeEntryTargetType)beGitLinkfeels wrong. Maybe skip a named default member, but start the values at 1?
You're right! Done.
|
@phkelley From the /// <summary>
/// Underlying type of a <see cref = "GitObject" />
/// </summary>
public enum ObjectType
{
/// <summary>
/// A commit object.
/// </summary>
Commit = 1,
/// <summary>
/// A tree (directory listing) object.
/// </summary>
Tree = 2,
/// <summary>
/// A file revision object.
/// </summary>
Blob = 3,
/// <summary>
/// An annotated tag object.
/// </summary>
Tag = 4,
} |
|
PR has been updated with new commits
|
Sadly, this is a breaking change as there's no way to allow a migration path through the use of an [Obsolete] attribute.
Relying on this properties would trigger multiple enumerations of the Tree entries. Exposing them is quite misleading for the consumer.
GitObjectTypeenumeration exposes many low level internal entries.This PR is an attempt at taming this hairy beast.
TreeEntryTargetTypeGitObjectTypein favor ofTreeEntryTargetTypeObjectTypeGitObjectTypein favor ofObjectType