git/list[1] front-page[2] threads[3] people[4] search[5] about
 

git update-index not delete lock file when using different worktree

From
Yue Lin Ho <yuelinho777@gmail.com>
Date
Jul 17, 2014, 03:18 UTC
Message-ID
<1405567125455-7615300.post@n2.nabble.com>

This is a [issue from TortoiseGit](https://code.google.com/p/tortoisegit/issues/detail?id=2233). After doing some test, I report it here. The following is the testing information I have tested.

### Folder Structure
```
Test
  |-- myrepo
  |     |-- bar.txt
  |     |-- foo.txt
  |
  |-- myrepo.git
        |-- .git
```
Testing repository is
[here](https://code.google.com/p/tortoisegit/issues/detail?id=2233#c2).
### Using different worktree
Set the config file (in the .git folder)
```
[core]
	worktree = ../../myrepo
```

### Test 1 - Git Bash ``` User@PC /d/Repo/myrepo.git (master) $ git --version git version 1.9.4.msysgit.0

User@PC /d/Repo/myrepo.git (master) $ git update-index --refresh fatal: Unable to write new index file ``` D:\Repo\myrepo.git\\**index.lock** is not deleted.

### Test 2 - Git 2.0.0 Copy testing repository into ```C:\msysgit\MyTest```

Execute```msys.bat``` ```$ vagrant up``` ```$ vagrant ssh``` ```vagrant@precise64:/vagrant/git$ cd /vagrant``` ```vagrant@precise64:/vagrant$ cd mytest/myrepo.git``` ``` vagrant@precise64:/vagrant/mytest/myrepo.git$ git --version git version 2.0.0 ``` ``` vagrant@precise64:/vagrant/mytest/myrepo.git$ git update-index --refresh fatal: Unable to write new index file ``` Also, **index.lock is not deleted.**

### Test 3 - gitdll of TortoiseGit (git version 1.9.0) Tracing the source code into **compat/mingw.c** line 289 : xutftowcs_canonical_path() get the value of var. wpathname ``` D:\Repo\myrepo\.git\index.lock ``` It should be ``` D:\Repo\myrepo.git\.git\index.lock ```

line 294 : _wunlink() try to delete the file.(```D:\Repo\myrepo\.git\index.lock```) line 295 : GetLastError() return 3(ERROR_PATH_NOT_FOUND) (Actually, there is no ```D:\Repo\myrepo\.git``` folder.)

-- View this message in context: http://git.661346.n2.nabble.com/git-update-index-not-delete-lock-file-when-using-different-worktree-tp7615300.html Sent from the git mailing list archive at Nabble.com.

Next: Yue Lin Ho
Message 1 of 4 in “git update-index not delete lock file when using different worktree”
  1. Yue Lin HoJul 17, 2014
  2. Yue Lin HoJul 17, 2014
  3. Duy NguyenJul 17, 2014
  4. Yue Lin HoJul 18, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.