summaryrefslogtreecommitdiff
path: root/src/worktree.c
diff options
context:
space:
mode:
authorEtienne Samson <samson.etienne@gmail.com>2018-08-17 00:51:51 +0200
committerEtienne Samson <samson.etienne@gmail.com>2018-08-17 00:51:51 +0200
commit59c2e70eeee8b2bae79d05060599114a5f6d737a (patch)
tree0d37664b7543f6c1a09721ce5afe69d5b2cc63b7 /src/worktree.c
parent622e12c1b26210d5fb2f1136a3ab4d3c81c1d2c8 (diff)
downloadlibgit2-59c2e70eeee8b2bae79d05060599114a5f6d737a.tar.gz
worktree: unlock should return 1 when the worktree isn't locked
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.
Diffstat (limited to 'src/worktree.c')
-rw-r--r--src/worktree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/worktree.c b/src/worktree.c
index 610fd7ee3..e06cdfb8d 100644
--- a/src/worktree.c
+++ b/src/worktree.c
@@ -426,7 +426,7 @@ int git_worktree_unlock(git_worktree *wt)
assert(wt);
if (!git_worktree_is_locked(NULL, wt))
- return 0;
+ return 1;
if (git_buf_joinpath(&path, wt->gitdir_path, "locked") < 0)
return -1;