Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

CommitObject with short hash value? #634

Closed
sergeyhush opened this issue Nov 2, 2017 · 2 comments
Closed

CommitObject with short hash value? #634

sergeyhush opened this issue Nov 2, 2017 · 2 comments

Comments

@sergeyhush
Copy link

I am trying to get a commit object using a short hash value, the code below does not work:
repo.CommitObject(plumbing.NewHash("abc123"))
This assumes that there is a full hash that starts with abc123.....
Is there a way, short of iterating repo.CommitObjects(), to do what I wanted?

@mcuadros
Copy link
Contributor

mcuadros commented Nov 2, 2017

Short hash are kind of porcelain operations, for the users, since this is a library to be used programmatically, the use of short hashes is not very useful.

But will be great having a function to search this, if someone requires to resolve short hashes.

@orirawlings
Copy link
Contributor

#599 includes a request to add behavior for parsing short hashes. Closing this as duplicate.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants