Skip to content
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

Have rebase and reset return HEAD oid #20116

Merged
merged 1 commit into from
Jan 19, 2017
Merged

Have rebase and reset return HEAD oid #20116

merged 1 commit into from
Jan 19, 2017

Conversation

kshyatt
Copy link
Contributor

@kshyatt kshyatt commented Jan 19, 2017

Added tests as well. I think the line 337 in libgit2.jl might be a bit sketch?

@kshyatt kshyatt added the libgit2 The libgit2 library or the LibGit2 stdlib module label Jan 19, 2017
@kshyatt kshyatt requested a review from simonbyrne January 19, 2017 01:10
@@ -333,10 +333,12 @@ function reset!(repo::GitRepo, committish::AbstractString, pathspecs::AbstractSt
# do not remove entries in the index matching the provided pathspecs with empty target commit tree
obj === nothing && throw(GitError(Error.Object, Error.ERROR, "`$committish` not found"))
try
reset!(repo, Nullable(obj), pathspecs...)
head = reset!(repo, Nullable(obj), pathspecs...)
return head
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's sketchy about this? Now we have finalizers attached, we could just get rid of the try/finally block altogether.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought maybe it should go in the finally block...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, because you don't want to return if there was an error.

@kshyatt kshyatt merged commit 271b318 into master Jan 19, 2017
@kshyatt kshyatt deleted the ksh/rebasereset branch January 19, 2017 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libgit2 The libgit2 library or the LibGit2 stdlib module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants