{"thread":{"id":"30845","subject":"Inconsistency in --work-tree behaviors","startedAt":"2012-06-19T23:26:03Z","lastAt":"2012-06-19T23:26:03Z","messageCount":1,"participants":["Nicholas Kirchner"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"193910","messageId":"AAB7D0C4-2A3E-4CCF-8D3E-A2C689B2826D@umn.edu","threadId":"30845","inReplyTo":null,"subject":"Inconsistency in --work-tree behaviors","fromName":"Nicholas Kirchner","fromEmail":"kirc0076@umn.edu","sentAt":"2012-06-19T23:26:03Z","receivedAt":"2012-06-19T23:26:03Z","isPatch":false,"sender":{"key":"kirc0076@umn.edu","avatar":null},"body":"There appears to be an inconsistency in how ls-files handles --work-tree compared to how status handles --work-tree.\n\nContext: I have a directory dotfiles.git with core.worktree = /Users/nick (my home directory; I'm on OS X Lion with MacPorts git version 1.7.10.4).\n\nBelow are the outputs of git ls-files and git status for the following options of --work-tree:\n1) none (equivalent to --work-tree=/Users/nick because of core.worktree setting, right?)\n2) --work-tree=~\n3) --work-tree=/Users/nick\n4) --work-tree=/Users/nick. (note the period at the end)\n\nNote that ls-files works properly with \"/Users/nick.\" and \"~\", while status works properly with \"/Users/nick\" and none.  No output is produced for \"git ls-files\" or \"git --work-tree=/Users/nick\".\n\n$ git status\n# On branch master\n# Untracked files:\n#   (use \"git add <file>...\" to include in what will be committed)\n#\n#\t../.hiya\nnothing added to commit but untracked files present (use \"git add\" to track)\n\n$ git ls-files\n\n$ git --work-tree=~ ls-files\n.bash_profile\n.bashrc\n.gemrc\n.profile\n.rvmrc\n.screenrc\n\n$ git --work-tree=~ status\nfatal: This operation must be run in a work tree\n\n$ git --work-tree=/Users/nick status\n# On branch master\n# Untracked files:\n#   (use \"git add <file>...\" to include in what will be committed)\n#\n#\t../.hiya\nnothing added to commit but untracked files present (use \"git add\" to track)\n\n$ git --work-tree=/Users/nick ls-files\n\n$ git --work-tree=/Users/nick. ls-files\n.bash_profile\n.bashrc\n.gemrc\n.profile\n.rvmrc\n.screenrc\n\n$ git --work-tree=/Users/nick. status\nfatal: This operation must be run in a work tree"}]}