`Object::as_tag` does not seems to work as expected.
Open
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 2.1k
- Forks
- 450
- Avg merge
- 11m
- Merged PRs (30d)
- 1
Description
I've been playing with the tag example, the method Object::as_tag always return none unless the tag has a message :
if let Some(tag) = obj.as_tag() {
print_tag(tag, args);
} else if let Some(commit) = obj.as_commit() {
print_commit(commit, name, args);
} else {
print_name(name);
}
- tagging a commit with
git tag v0.0.0and trying to convert the corresponding object to a tag will returnNone. - tagging a commit with
git tag -a v0.0.0 -m "some message"and trying to convert the corresponding object to a tag will returnSome(Tag { name: "v0.0.0", id: oid... })
Is this an expected behavior ? If it is, It might be a good idea to document it. I'd be happy to submit a PR.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with examples/tag.rs and the Object::as_tag API, then reproduce the two cases using lightweight and annotated git tags. Check whether the differing results are expected for the underlying object types; done means the behavior is clarified and the relevant API documentation or conversion is updated as appropriate.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, rust
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100