Skip to content

Commit dc93306

Browse files
committed
git-repo-analyser: handle bare repo and better progress-bar - fix for bare and trace
1 parent b2781f2 commit dc93306

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

git-repo-analyzer/git-object-sizes-in-repo-analyzer.sh

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,6 @@ function progress_bar_update (){
5454
fi
5555
}
5656

57-
if [[ $(git rev-parse --is-bare-repository) == true ]]; then
58-
echo "repo_type=bare ( bare / normal )" echo
59-
pack_dir="./objects"
60-
git_dir="."
61-
else
62-
echo "repo_type=normal ( bare / normal )"
63-
git_dir=".git"
64-
pack_dir=".git/objects"
65-
fi
66-
echo
67-
export pack_dir
6857

6958
if [[ ${debug:-} == true ]]; then
7059
command -v find
@@ -80,6 +69,19 @@ if [[ "${1:-}" != "" ]]; then
8069
test -e ${1} && cd ${1}
8170
fi
8271
echo
72+
73+
if [[ $(git rev-parse --is-bare-repository) == true ]]; then
74+
echo "repo_type=bare ( bare / normal )" echo
75+
pack_dir="./objects"
76+
git_dir="."
77+
else
78+
echo "repo_type=normal ( bare / normal )"
79+
git_dir=".git"
80+
pack_dir=".git/objects"
81+
fi
82+
echo
83+
export pack_dir
84+
8385
echo "Analyzing git in: $(pwd) "
8486
echo "Saving outfiles in: ${WORKSPACE}"
8587
echo

0 commit comments

Comments
 (0)