Skip to content

Commit

Permalink
Merge pull request #403 from annaborn/master
Browse files Browse the repository at this point in the history
add option to disable the .git suffix
  • Loading branch information
doudou authored May 7, 2024
2 parents d591195 + 9d49c96 commit 1c0a06c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 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,7 @@ 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$/
url += ".git" if add_suffix && 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 1c0a06c

Please sign in to comment.