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

[BUG] git-stash confused when directory replaced with symlink

From
VVovan-VE <vovan-ve@yandex.ru>
Date
Feb 10, 2014, 10:54 UTC
Message-ID
<op.xa2a9r00tcop7l@dev-server>
Hello!

Looks like a bug. `git stash` fails with fatal error, when whole subdirectory is replaced with a symlink.

I'm using latest Git/1.8.5.4 under Ubuntu 12.04.4 x64.
Steps to reproduce initial state:
     $ git init
     $ mkdir dir
     $ touch dir/file.txt
     $ git add dir/file.txt
     $ git commit -m 'Initial commit'
     $ rm -r dir
     $ ln -s -T /something/does/not/matter dir
     $ git status
     # Changes not staged for commit:
     #
     #	deleted:    dir/file.txt
     #
     # Untracked files:
     #
     #	dir
Now the bug itself:
     $ git stash
     error: 'dir/file.txt' is beyond a symbolic link
     fatal: Unable to process path dir/file.txt
     Cannot save the current worktree state

Target of the symlink doesn't matter, as far as I understand. Doing `git add --all` or `git rm --cached dir/file.txt` doesn't change the result - still fatal.

Git tries to delete file "dir/file.txt", which does not exist. It confused by existing "dir".

However `git checkout .` works fine: symlink deleted, directory restored.
-- 
Vovan-VE
Message 1 of 1 in “[BUG] git-stash confused when directory replaced with symlink”
  1. Vovan-VEFeb 10, 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.