"error": "sync: creat(xxx) failed: Not a directory: not a directory"
- Dominant language
- C++
- Stars
- 13.7k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
When testing watchman with git submodules, I execute the following query:
["query", "C:/git-sdk-64/usr/src/git/t/trash directory.t7506-status-submodule/sub", {"since": 1499713020, "fields": ["name"], "expression": ["not", ["allof", ["since", 1499713020, "cclock"], ["not", "exists"]]]}]
Which results in the following error:
{
"version": "4.9.0",
"error": "sync: creat(C:/git-sdk-64/usr/src/git/t/trash directory.t7506-status-submodule/sub/.git/.watchman-cookie-BenPeart-HP-58768-13) failed: Not a directory: not a directory"
}
$ watchman version
{
"version": "4.9.0",
"buildinfo": "981452aff98ee5064c06a3a8cd39ff2394846114 2017-07-03T21:52:36.0000000Z"
}
It appears that there is some git specific code in Watchman (note the path contains "/sub/.git/.watchman" which in the case of sub modules, is invalid. Sub-modules take advantage of the git feature that allows the .git folder to be replaced with a .git file that contains the path to the actual folder. Here is the contents of the sub/.git file:
$ cat .git
gitdir: C:/git-sdk-64/usr/src/git/t/trash directory.t7506-status-submodule/sub/../.real
I'm surprised/worried that Watchman has git specific logic but if it needs to continue to exist, Watchman will need to handle the case where .git is a file instead of a folder as this can happen in any .git repo in addition to being used for sub-modules.
I also wonder if this (creating a cookie) is contributing to the random errors where a file is in use within a folder which prevents the folder from being deleted. I'll report that separately.
Contributor guide
Assessment
This issue has not been assessed yet.