Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Be more careful when determining whether a remote was configured
One of the really nice features of the ~/.gitconfig file is that users can override defaults by their own preferred settings for all of their repositories. One such default that some users like to override is whether the "origin" remote gets auto-pruned or not. The user would simply call git config --global remote.origin.prune true and from now on all "origin" remotes would be pruned automatically when fetching into the local repository. There is just one catch: now Git thinks that the "origin" remote is configured, as it does not discern between having a remote whose fetch (and/or push) URL and refspec is set, and merely having preemptively-configured, global flags for specific remotes. Let's fix this by telling Git that a remote is not configured unless any fetch/push URL or refspect is configured explicitly. As a special exception, we deem a remote configured also when *only* the "vcs" setting is configured. The commit a31eeae (remote: use remote_is_configured() for add and rename, 2016-02-16) specifically extended our test suite to verify this, so it is safe to assume that there has been at least one user with a legitimate use case for this. This fixes git-for-windows#888 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
- Loading branch information