diff options
author | Marc Cornellà <hello@mcornella.com> | 2022-01-27 18:01:27 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-27 18:01:27 +0100 |
commit | 59c40eee8e9232f556e9d4c8c97eb1b866846af3 (patch) | |
tree | afff783e15b19b00b44c3e47573b2c6f7a8be107 /tools/install.sh | |
parent | 3741d1aa0253291c432e6ce3469f1d16dedbc914 (diff) | |
download | zsh-59c40eee8e9232f556e9d4c8c97eb1b866846af3.tar.gz zsh-59c40eee8e9232f556e9d4c8c97eb1b866846af3.tar.bz2 zsh-59c40eee8e9232f556e9d4c8c97eb1b866846af3.zip |
fix(installer): avoid `git clone -c` to support git v1.7.1 (#10621)
Diffstat (limited to 'tools/install.sh')
-rwxr-xr-x | tools/install.sh | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/tools/install.sh b/tools/install.sh index 34dca8413..2290bc1eb 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -263,13 +263,19 @@ setup_ohmyzsh() { exit 1 fi - git clone -c core.eol=lf -c core.autocrlf=false \ - -c fsck.zeroPaddedFilemode=ignore \ - -c fetch.fsck.zeroPaddedFilemode=ignore \ - -c receive.fsck.zeroPaddedFilemode=ignore \ - -c oh-my-zsh.remote=origin \ - -c oh-my-zsh.branch="$BRANCH" \ - --depth=1 --branch "$BRANCH" "$REMOTE" "$ZSH" || { + # Manual clone with git config options to support git < v1.7.2 + git init "$ZSH" && cd "$ZSH" \ + && git config core.eol lf \ + && git config core.autocrlf false \ + && git config fsck.zeroPaddedFilemode ignore \ + && git config fetch.fsck.zeroPaddedFilemode ignore \ + && git config receive.fsck.zeroPaddedFilemode ignore \ + && git config oh-my-zsh.remote origin \ + && git config oh-my-zsh.branch "$BRANCH" \ + && git remote add origin "$REMOTE" \ + && git fetch --depth=1 origin \ + && git checkout -b "$BRANCH" "origin/$BRANCH" || { + rm -rf "$ZSH" fmt_error "git clone of oh-my-zsh repo failed" exit 1 } |