{"thread":{"id":"44499","subject":"git stash can recursively delete a directory with no warning","startedAt":"2016-11-16T20:19:15Z","lastAt":"2016-11-16T20:19:15Z","messageCount":1,"participants":["Russell Yanofsky"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"306080","messageId":"CA+ip-Bt96KRfv_UdYKDTEzDgR0QLtPshsZszXsnCw8wRTBG2WQ@mail.gmail.com","threadId":"44499","inReplyTo":null,"subject":"git stash can recursively delete a directory with no warning","fromName":"Russell Yanofsky","fromEmail":"russ@yanofsky.org","sentAt":"2016-11-16T20:19:09Z","receivedAt":"2016-11-16T20:19:15Z","isPatch":false,"sender":{"key":"russ@yanofsky.org","avatar":null},"body":"Using git 2.10.1, I recently lost the contents of an entire directory\nby running a \"git stash\" command. I don't know if this known behavior,\nbut it seems pretty dangerous. To trigger the bug, all you have to do\nis check out a repository containing a symlink, delete the symlink,\nand then create a directory with files at the path where the deleted\nsymlink was. After this, running \"git stash\" will recursively delete\nthe directory, leaving no way to recover the data.\n\nHere are minimal steps to reproduce:\n\nmkdir test-repo\ncd test-repo\ngit init\nln -s location symlink\ngit add symlink\ngit commit -m'add symlink'\nrm symlink\nmkdir symlink\necho important-data > symlink/important-data\ngit stash # recursively deletes entire contents of \"symlink\" directory\n"}]}