-
Notifications
You must be signed in to change notification settings - Fork 899
Introduce reflog #388
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce reflog #388
Conversation
@haacked How do you feel about this? |
@nulltoken excited to see this! Having it automatically created on commit sounds good to me. What about other cases when reflog entries are created such as checking out branches and merging two branches? |
@haacked Merging seems a bit far away. However, checking out sounds achievable. Maybe could you create a separate feature request with the use cases you'd like to see implemented? |
Sure. |
@nulltoken Sorry, I missed a couple of things in my class definitions. Travis should not complain anymore. 🙏 |
|
||
// Initial commit assertions | ||
Assert.Equal("[email protected]", reflog.Last().Commiter.Email); | ||
Assert.Contains("clone: from c:/GitHub/libgit2sharp/Resources/testrepo.git", reflog.Last().Message); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would StartWith()
work as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used Contains()
because there was a trailing "\r" in the clone message... Maybe a minor bug from libgit? This does not happen on commit related reflog entries.
Anyway, I can make it work with Assert.Equal()
adding the trailing "\r" in my expectation.
Although, StartWith()
does not belong to XUnit built-in assertions methods!
returns the reflog of the reference given as parameter
Fix libgit2#371 Insert entry on HEAD and target direct reference on commit Tag as initial the first commit
Here is a first amend on the PR.
|
@Saaman Travis ❤️ you. And so am I! Merged. |
This PR is originated by issue #371.
I first introduced the ability to read the reflog :
A
ReflogCollection
is aIEnumerable<ReflogEntry>
, whereReflogEntry
contains details about a single entry.Then I corrected the issue by calling
ReflogCollection.Append()
from theRepository.Commit()
method.I implemented correct message formatting for standard commits and ammended commits. I'm not sure if there is another case to cover.