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

Re: fatal: Could not get current working directory: Permission denied | affected 2.10,2.11,2.12, but not 1.9.5 |

From
René Scharfe <l.s.r@web.de>
Date
Mar 13, 2017, 17:31 UTC
Message-ID
<b9dc5b05-46e6-a3d7-2fb0-638bff2da676@web.de>
In-Reply-To
<bolnkqijewdhfhyoqodf@zfyt>
Am 13.03.2017 um 13:23 schrieb Zenobiusz Kunegunda:
Show 14 quoted lines
> Tested on ZFS filesystem
> 
> 
> 
>     [test0@s0]:<~>$ mkdir '232222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222'
>     [test0@s0]:<~>$ cd 232222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222/
>     [test0@s0]:<~/232222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222>$ git status
>     fatal: Unable to read current working directory: Permission denied
> 
>     [test0@s0]:<~/232222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222>$ git blahblahblah
>     fatal: Unable to read current working directory: Permission denied
> 
> 
> But when I create directory with same name (232...) as it's subdirectory everything works as expected inside that subdirectory.

Earlier I checked on UFS. Now I tried the above commands on ZFS, but they work as expected:

  $ git status
  fatal: Not a git repository (or any parent up to mount point /src)
  Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).

Git checks out if it's in a git repository and if the current working directory isn't one then it goes to the parent directories recursively until it finds the root of a repo or a file system boundary or / (root).

You can see where your invocation goes to with:
	$ strace git status 2>&1 >/dev/null | grep chdir
René
Previous: Zenobiusz KunegundaNext: Zenobiusz Kunegunda
Message 6 of 23 in “fatal: Could not get current working directory: Permission denied | affected 2.10,2.11,2.12, but not 1.9.5 |”
  1. Zenobiusz KunegundaMar 6, 2017
  2. René ScharfeMar 8, 2017
  3. Zenobiusz KunegundaMar 9, 2017
  4. René ScharfeMar 11, 2017
  5. Zenobiusz KunegundaMar 13, 2017
  6. René ScharfeMar 13, 2017
  7. Zenobiusz KunegundaMar 14, 2017
  8. Zenobiusz KunegundaMar 13, 2017
  9. René ScharfeMar 13, 2017
  10. Zenobiusz KunegundaMar 14, 2017
  11. René ScharfeMar 14, 2017
  12. Zenobiusz KunegundaMar 15, 2017
  13. René ScharfeMar 15, 2017
  14. René ScharfeMar 17, 2017
  15. Stefan BellerMar 17, 2017
  16. René ScharfeMar 17, 2017
  17. Jeff KingMar 17, 2017
  18. René ScharfeMar 17, 2017
  19. Zenobiusz KunegundaMar 21, 2017
  20. René ScharfeMar 21, 2017
  21. Zenobiusz KunegundaMar 22, 2017
  22. Zenobiusz KunegundaMar 21, 2017
  23. Zenobiusz KunegundaMar 9, 2017

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.