# \[PATCH v7 12/31\] git-sh-setup.sh: use rev-parse --git-path to get $GIT\_DIR/objects

- From: Nguyễn Thái Ngọc Duy \<hidden\>
- Date: 2016-06-15 23:01:54 
- List: git
- Page: https://ratatoskr.run/git/2016/06/7636753
- Thread: https://ratatoskr.run/git/2016/06/7636417/t.md

```text
If $GIT_COMMON_DIR is set, $GIT_OBJECT_DIRECTORY should be
$GIT_COMMON_DIR/objects, not $GIT_DIR/objects. Just let rev-parse
--git-path handle it.

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
---
 git-sh-setup.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/git-sh-setup.sh b/git-sh-setup.sh
index 9447980..d3dbb2f 100644
--- a/git-sh-setup.sh
+++ b/git-sh-setup.sh
@@ -345,7 +345,7 @@ then
 		echo >&2 "Unable to determine absolute path of git directory"
 		exit 1
 	}
-	: ${GIT_OBJECT_DIRECTORY="$GIT_DIR/objects"}
+	: ${GIT_OBJECT_DIRECTORY="$(git rev-parse --git-path objects)"}
 fi
 
 peel_committish () {
-- 
1.9.1.346.ga2b5940
```
