)]}'
{
  "commit": "9273b56278e64dd47b1a96a705ddf46aeaf6afe3",
  "tree": "38456640aff7b731721603219362a9516bd94248",
  "parents": [
    "281907574ca420cc9a800190509adbf89bf9a2d1"
  ],
  "author": {
    "name": "Eric Kidd",
    "email": "git@randomhacks.net",
    "time": "Tue Feb 03 13:27:03 2009 -0500"
  },
  "committer": {
    "name": "Junio C Hamano",
    "email": "gitster@pobox.com",
    "time": "Tue Feb 03 21:54:02 2009 -0800"
  },
  "message": "filter-branch: Fix fatal error on bare repositories\n\nWhen git filter-branch is run on a bare repository, it prints out a fatal\nerror message:\n\n  $ git filter-branch branch\n  Rewrite 476c4839280c219c2317376b661d9d95c1727fc3 (9/9)\n  WARNING: Ref \u0027refs/heads/branch\u0027 is unchanged\n  fatal: This operation must be run in a work tree\n\nNote that this fatal error message doesn\u0027t prevent git filter-branch from\nexiting successfully. (Why doesn\u0027t git filter-branch actually exit with an\nerror when a shell command fails? I\u0027m not sure why it was designed this\nway.)\n\nThis error message is caused by the following section of code at the end of\ngit-filter-branch.sh:\n\n  if [ \"$(is_bare_repository)\" \u003d false ]; then\n          unset GIT_DIR GIT_WORK_TREE GIT_INDEX_FILE\n          test -z \"$ORIG_GIT_DIR\" || {\n                  GIT_DIR\u003d\"$ORIG_GIT_DIR\" \u0026\u0026 export GIT_DIR\n          }\n          ... elided ...\n          git read-tree -u -m HEAD\n  fi\n\nThe problem is the call to $(is_bare_repository), which is made before\nGIT_DIR and GIT_WORK_TREE are restored.  This call always returns \"false\",\neven when we\u0027re running in a bare repository.  But this means that we will\nattempt to call \u0027git read-tree\u0027 even in a bare repository, which will fail\nand print an error.\n\nThis patch modifies git-filter-branch.sh to restore the original\nenvironment variables before trying to call is_bare_repository.\n\nSigned-off-by: Junio C Hamano \u003cgitster@pobox.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "c106f45af73446d26630030f77107efa520aa296",
      "old_mode": 33261,
      "old_path": "git-filter-branch.sh",
      "new_id": "56d1bd0f99743fdb4ba53c457d823b4efc7c1bdd",
      "new_mode": 33261,
      "new_path": "git-filter-branch.sh"
    },
    {
      "type": "modify",
      "old_id": "b0a9d7d536314ec842b141c09ba0d6f8b06b6288",
      "old_mode": 33261,
      "old_path": "t/t7003-filter-branch.sh",
      "new_id": "6a9936e5c45a973f2fd64a2fe20463497f9564eb",
      "new_mode": 33261,
      "new_path": "t/t7003-filter-branch.sh"
    }
  ]
}
