{"thread":{"id":"57409","subject":"[Bugreport] Git Checkout-Index from sub-folder","startedAt":"2022-02-13T10:37:32Z","lastAt":"2022-02-13T10:37:32Z","messageCount":1,"participants":["Tobias Heineken"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"448341","messageId":"eb022c46-81be-2112-76fa-3c8b783767bc@robotics-erlangen.de","threadId":"57409","inReplyTo":null,"subject":"[Bugreport] Git Checkout-Index from sub-folder","fromName":"Tobias Heineken","fromEmail":"tobias.heineken@robotics-erlangen.de","sentAt":"2022-02-13T10:29:03Z","receivedAt":"2022-02-13T10:37:32Z","isPatch":false,"sender":{"key":"tobias.heineken@robotics-erlangen.de","avatar":null},"body":"Dear all,\n\nI've run into an issue with git checkout-index -a --prefix FOO/,\nwhere it would not do any (visible) actions\nwhen called from a sub directory.\n\nThe following bug report (including a minimized example) was created in \na virtual machine (with a more recent git), but I first noticed the bug \non my machine with git version 2.17.1.\n\nI did not find a public git issue tracker online,\nso I have no idea if this issue already came up.\nI'm also currently trying to test this on a more recent git than 2.31,\nbut I don't know when I'll have access to that.\n\nThanks for your help,\nTobias Heineken\n\n\n==== git-bugreport-2022-02-13-1034.txt ====\nThank you for filling out a Git bug report!\nPlease answer the following questions to help us understand your issue.\n\nWhat did you do before the bug happened? (Steps to reproduce your issue)\n```\nmkdir test\ncd test\ngit init\necho \"Hallo Welt\" > test\ngit add test\ngit commit -m \"initial commit\"\nmkdir temp\ncd temp\ngit checkout-index -a --prefix NEW/\n```\n\nWhat did you expect to happen? (Expected behavior)\nI expected to get a copy of my test file in either test/temp/NEW/test or \ntest/NEW/test.\n\nWhat happened instead? (Actual behavior)\nNothing (at least nothing observable to me).\nNote that doing git checkout-index on top level (test) works, but when \nchanging the working directory to the sub directory temp first it does \nno longer work.\nAlso note that git checkout-index --prefix NEW/ -- ../test kind of \nworks, as it creates test/NEW/test. Not the first place I was looking \nfor that file, but at least it is there.\n\nWhat's different between what you expected and what actually happened?\nThere is no copy of my test file.\n\nAnything else you want to add:\nI would be fine with either of the following 4 options:\n(1) The Manpage for git checkout-index clearly states that it should \nonly be called in the git root directory (test in this case)\n(2) The prefix is interpreted relative to the current working directory \n(and this is clearly explained in the manpage)\n(3) The prefix is interpreted relative to the git root directory (and \nthis is clearly explained in the manpage)\n(4) git checkout-index complains visibly when called with a working \ndirectory that is not equal to the git root directory\n\n[System Info]\ngit version:\ngit version 2.31.1\ncpu: x86_64\nno commit associated with this build\nsizeof-long: 8\nsizeof-size_t: 8\nshell-path: /bin/sh\nuname: Linux 5.3.18-59.24-default #1 SMP Mon Sep 13 15:06:42 UTC 2021 \n(2f872ea) x86_64\ncompiler info: gnuc: 7.5\nlibc info: glibc: 2.31\n$SHELL (typically, interactive shell): /bin/bash\n\n\n[Enabled Hooks]\n"}]}