Skip to content

worktree: unlock should return 1 when the worktree isn't locked#4769

Merged
pks-t merged 1 commit intolibgit2:masterfrom
tiennou:fix/worktree-unlock
Aug 24, 2018
Merged

worktree: unlock should return 1 when the worktree isn't locked#4769
pks-t merged 1 commit intolibgit2:masterfrom
tiennou:fix/worktree-unlock

Conversation

@tiennou
Copy link
Copy Markdown
Contributor

@tiennou tiennou commented Aug 16, 2018

The documentation states that git_worktree_unlock returns 0 on success,
and 1 on success if the worktree wasn't locked. Turns out we were
returning 0 in any of those cases.

Found it while writing test cases for Objective-Git.

The documentation states that git_worktree_unlock returns 0 on success,
and 1 on success if the worktree wasn't locked. Turns out we were
returning 0 in any of those cases.
@pks-t
Copy link
Copy Markdown
Member

pks-t commented Aug 24, 2018

While I would've designed the interface differently by now (returning GIT_ELOCKED, which we already have), this at least fixes code to match our documentation. So thanks for discovering and fixing it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants