Skip to content
Myr

[Fix] install.sh: Force remote name of cloned repo to be 'origin'

Before adoption: this commit came in with the history the project adopted, so no landing records it.

The script assumes that the name of the remote is `origin`, but this is not the case if the user has set `clone.defaultRemoteName` to another value in the ~/.gitconfig (or elsewhere in the configuration). Adding `-o origin` ensures that the remote will be called `origin` regardless of the `clone.defaultRemoteName` setting. Per PR #3341: - The minimum Git version this should work with is v1.7.10. (This is not documented in the repo itself; it's just an implicit requirement.) - The `--origin` option was added to `git clone` in commit 98a4fef3f2 which was released in v1.2.5. From the diff of that commit, the `-o` option was already available at that time. So this easily satisfies the above. - A comment in #3341 indicates that `-o` was added in v1.1.0. I've not verified this, but we probably don't need to track that down since by the above we're already well within requirements.

authored by Curt J. Sampson · committed by Curt J. Sampson · parent 44a3cdb · Browse files · 1 file+1 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−1 removed

  • other:+1 added−1 removed

1 file+1 added−1 removed

modified:install.sh+1 added-1 removed
161 unmodified lines
162 exit 2163 }164 else165 # Cloning repo166 command git clone "$(nvm_source)" --depth=1 "${INSTALL_DIR}" || {166 command git clone -o origin "$(nvm_source)" --depth=1 "${INSTALL_DIR}" || {167 nvm_echo >&2 'Failed to clone nvm repo. Please report this!'168 exit 2169 }170 fi
325 unmodified lines