Skip to content

Commit

Permalink
add option to disable the .git suffix
Browse files Browse the repository at this point in the history
  • Loading branch information
annaborn committed Mar 8, 2024
1 parent e10dd92 commit 59eb9ca
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/autoproj/git_server_configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ def self.git_server_configuration(name, base_url,
disabled_methods: [],
config: Autoproj.config,
fallback_to_http: nil,
lazy: false)
lazy: false,
add_suffix: true)

disabled_methods = Array(disabled_methods)

Expand All @@ -100,7 +101,8 @@ def self.git_server_configuration(name, base_url,
end

Autoproj.add_source_handler name.downcase do |url, private: false, **vcs_options|
url += ".git" if url !~ /\.git$/
if add_suffix
url += ".git" if url !~ /\.git$/
url = "/#{url}" if url !~ /^\//

unless GIT_SERVER_CONFIG_VARS.all? { |v| config.has_value_for?("#{name}#{v}") }
Expand Down

0 comments on commit 59eb9ca

Please sign in to comment.