Skip to content

Globally set git protocol is ignored in some places #8250

Description

@samcoe

As part of the work done in #8213 I asked @williammartin to change a handful of places from cfg.GetOrDefault(hostname, "git_protocol") to cfg.Authentication().GitProtocol(hostname). Unfortunately I was incorrect thinking that these two function calls had identical implementations. The GetOrDefault implementation checks the git_protocol key of the hostname, if it does not exist it checks the global git_protocol key, and if that does not exist it returns the default. The GitProtocol implementation checks the git_protocol key of the hostname, and if it does not exist it returns the default. It misses the step of checking the global git_protocol key and We should rectify that.

Since GitProtocol will be required to check the global git_protocol key we should evaluate if the method actually belongs on the AuthConfig struct or in the Config interface.

Activity

  1. added
    bugSomething isn't working
    priority-3Affects a small number of users or is largely cosmetic
    on Oct 25, 2023
  2. 9901986942darwin-boop commented on Oct 31, 2025

    @9901986942darwin-boop

    As part of the work done in #8213 I asked @williammartin to change a handful of places from cfg.GetOrDefault(hostname, "git_protocol") to cfg.Authentication().GitProtocol(hostname). Unfortunately I was incorrect thinking that these two function calls had identical implementations. The GetOrDefault implementation checks the git_protocol key of the hostname, if it does not exist it checks the global git_protocol key, and if that does not exist it returns the default. The GitProtocol implementation checks the git_protocol key of the hostname, and if it does not exist it returns the default. It misses the step of checking the global git_protocol key and We should rectify that.

    Since GitProtocol will be required to check the global git_protocol key we should evaluate if the method actually belongs on the AuthConfig struct or in the Config interface.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpriority-3Affects a small number of users or is largely cosmetic

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions