{"thread":{"id":"40376","subject":"BUG: git_work_tree issue with git alias and scripting","startedAt":"2015-09-18T07:33:44Z","lastAt":"2015-09-18T07:33:44Z","messageCount":1,"participants":["Tuomo Tanskanen"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"270278","messageId":"CAE_UwRp7LB0E636u9cOEisMgJi3xApAVPPH_T2Hpkm43DS5F0A@mail.gmail.com","threadId":"40376","inReplyTo":null,"subject":"BUG: git_work_tree issue with git alias and scripting","fromName":"Tuomo Tanskanen","fromEmail":"tuomo@tanskanen.org","sentAt":"2015-09-18T07:33:44Z","receivedAt":"2015-09-18T07:33:44Z","isPatch":false,"sender":{"key":"tuomo@tanskanen.org","avatar":null},"body":"Hello,\n\nAttached is a simple script exposing a possible bug when git alias is\ncombined with git commands in script. It should be pretty self-explanatory.\nCheck what it does and execute it. On my Linux and OSX, both with git 2.5.1\nbehave the same, ie. git add fails even the file \"test\" is in $PWD.\n\nSummary: $GIT_WORK_TREE persists in env, and then some git commands operate\non repo in $PWD (like git log), while some others (like git add) operate on\nrepo in $GIT_WORK_TREE, making it inconsistent and results in very\nunexpected results.\n\nCheers, Tuomo\n"}]}