File tree Expand file tree Collapse file tree 1 file changed +4
-14
lines changed
internal/test_helpers/pass_all Expand file tree Collapse file tree 1 file changed +4
-14
lines changed Original file line number Diff line number Diff line change 1111# Find git binary in /tmp locations
1212for tmpdir in /tmp/git-* /git; do
1313 if [ -x " $tmpdir " ]; then
14- " $tmpdir " config --global init.defaultBranch main
14+ if ! " $tmpdir " config --global --get init.defaultBranch > /dev/null 2>&1 ; then
15+ " $tmpdir " config --global init.defaultBranch main
16+ fi
1517
1618 # commit-tree stage doesn't use call this script for init
1719 # So we need to run this setup again
@@ -24,19 +26,7 @@ for tmpdir in /tmp/git-*/git; do
2426 " $tmpdir " add .
2527 fi
2628
27- if [ " $1 " != " init" ]; then
28- exec " $tmpdir " " $@ "
29- # If init.defaultBranch is not set, set it to main
30- # If not set globally, git always shows a warning
31- # if ! "$tmpdir" config --global --get init.defaultBranch >/dev/null 2>&1; then
32- # "$tmpdir" config --global init.defaultBranch main
33- # fi
34- # Setup is run locally so it's only set for the current temp repo
35- " $tmpdir " config --local user.email " hello@codecrafters.io"
36- " $tmpdir " config --local user.name " CodeCrafters-Bot"
37- else
38- exec " $tmpdir " " $@ "
39- fi
29+ exec " $tmpdir " " $@ "
4030 fi
4131done
4232
You can’t perform that action at this time.
0 commit comments