Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
503af775
Unverified
Commit
503af775
authored
Aug 24, 2018
by
Patrick Steinhardt
Committed by
GitHub
Aug 24, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4769 from tiennou/fix/worktree-unlock
worktree: unlock should return 1 when the worktree isn't locked
parents
0036993b
59c2e70e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
src/worktree.c
+1
-1
tests/worktree/worktree.c
+2
-2
No files found.
src/worktree.c
View file @
503af775
...
...
@@ -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
;
...
...
tests/worktree/worktree.c
View file @
503af775
...
...
@@ -477,7 +477,7 @@ void test_worktree_worktree__unlock_unlocked_worktree(void)
cl_git_pass
(
git_worktree_lookup
(
&
wt
,
fixture
.
repo
,
"testrepo-worktree"
));
cl_assert
(
!
git_worktree_is_locked
(
NULL
,
wt
));
cl_assert
(
git_worktree_unlock
(
wt
)
==
0
);
cl_assert
_equal_i
(
1
,
git_worktree_unlock
(
wt
)
);
cl_assert
(
!
wt
->
locked
);
git_worktree_free
(
wt
);
...
...
@@ -490,7 +490,7 @@ void test_worktree_worktree__unlock_locked_worktree(void)
cl_git_pass
(
git_worktree_lookup
(
&
wt
,
fixture
.
repo
,
"testrepo-worktree"
));
cl_git_pass
(
git_worktree_lock
(
wt
,
NULL
));
cl_assert
(
git_worktree_is_locked
(
NULL
,
wt
));
cl_
git_pass
(
git_worktree_unlock
(
wt
));
cl_
assert_equal_i
(
0
,
git_worktree_unlock
(
wt
));
cl_assert
(
!
wt
->
locked
);
git_worktree_free
(
wt
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment