@@ -245,7 +245,7 @@ static void validate_worktree_add(const char *path, const struct add_opts *opts)
245
245
if (!wt )
246
246
goto done ;
247
247
248
- locked = !!is_worktree_locked (wt );
248
+ locked = !!worktree_lock_reason (wt );
249
249
if ((!locked && opts -> force ) || (locked && opts -> force > 1 )) {
250
250
if (delete_git_dir (wt -> id ))
251
251
die (_ ("unable to re-add worktree '%s'" ), path );
@@ -682,7 +682,7 @@ static int lock_worktree(int ac, const char **av, const char *prefix)
682
682
if (is_main_worktree (wt ))
683
683
die (_ ("The main working tree cannot be locked or unlocked" ));
684
684
685
- old_reason = is_worktree_locked (wt );
685
+ old_reason = worktree_lock_reason (wt );
686
686
if (old_reason ) {
687
687
if (* old_reason )
688
688
die (_ ("'%s' is already locked, reason: %s" ),
@@ -714,7 +714,7 @@ static int unlock_worktree(int ac, const char **av, const char *prefix)
714
714
die (_ ("'%s' is not a working tree" ), av [0 ]);
715
715
if (is_main_worktree (wt ))
716
716
die (_ ("The main working tree cannot be locked or unlocked" ));
717
- if (!is_worktree_locked (wt ))
717
+ if (!worktree_lock_reason (wt ))
718
718
die (_ ("'%s' is not locked" ), av [0 ]);
719
719
ret = unlink_or_warn (git_common_path ("worktrees/%s/locked" , wt -> id ));
720
720
free_worktrees (worktrees );
@@ -787,7 +787,7 @@ static int move_worktree(int ac, const char **av, const char *prefix)
787
787
validate_no_submodules (wt );
788
788
789
789
if (force < 2 )
790
- reason = is_worktree_locked (wt );
790
+ reason = worktree_lock_reason (wt );
791
791
if (reason ) {
792
792
if (* reason )
793
793
die (_ ("cannot move a locked working tree, lock reason: %s\nuse 'move -f -f' to override or unlock first" ),
@@ -900,7 +900,7 @@ static int remove_worktree(int ac, const char **av, const char *prefix)
900
900
if (is_main_worktree (wt ))
901
901
die (_ ("'%s' is a main working tree" ), av [0 ]);
902
902
if (force < 2 )
903
- reason = is_worktree_locked (wt );
903
+ reason = worktree_lock_reason (wt );
904
904
if (reason ) {
905
905
if (* reason )
906
906
die (_ ("cannot remove a locked working tree, lock reason: %s\nuse 'remove -f -f' to override or unlock first" ),
0 commit comments