Hi Duy: I tested your patch. It works. :) (only one case.) Thank you. There are 26 hold_locked_index() in these files: Line 475 of builtin\add.c Line 4234 of \builtin\apply.c Line 259 of \builtin\checkout.c Line 448 of \builtin\checkout.c Line 139 of \builtin\checkout-index.c Line 643 of \builtin\clone.c Line 323 of \builtin\commit.c Line 362 of \builtin\commit.c Line 383 of \builtin\commit.c Line 434 of \builtin\commit.c Line 1295 of \builtin\commit.c Line 479 of \builtin\describe.c Line 211 of \builtin\diff.c Line 660 of \builtin\merge.c Line 700 of \builtin\merge.c Line 88 of \builtin\mv.c Line 152 of \builtin\read-tree.c Line 338 of \builtin\reset.c Line 296 of \builtin\rm.c Line 808 of \builtin\update-index.c Line 588 of \cache-tree.c Line 75 of \merge.c Line 2004 of \merge-recursive.c Line 482 of \rerere.c Line 301 of \sequencer.c Line 671 of \sequencer.c Yue Lin -- View this message in context: http://git.661346.n2.nabble.com/git-update-index-not-delete-lock-file-when-using-different-worktree-tp7615300p7615378.html Sent from the git mailing list archive at Nabble.com. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html