From: Yue Lin Ho <yuelinho777@gmail.com>
To: git@vger.kernel.org
Subject: git update-index not delete lock file when using different worktree
Date: Wed, 16 Jul 2014 20:18:45 -0700 (PDT) [thread overview]
Message-ID: <1405567125455-7615300.post@n2.nabble.com> (raw)
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 reply other threads:[~2014-07-17 3:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-17 3:18 Yue Lin Ho [this message]
2014-07-17 8:27 ` git update-index not delete lock file when using different worktree Yue Lin Ho
2014-07-17 10:36 ` Duy Nguyen
2014-07-18 8:21 ` Yue Lin Ho
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1405567125455-7615300.post@n2.nabble.com \
--to=yuelinho777@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).