Skip to content

Commit ef9dda2

Browse files
committed
Avoid nesting cloned OGM repos inside themselves
Providing both `directory` and `path` to Git.clone results in the repo being cloned into a directory nested inside itself. This may be a fix for #144.
1 parent e7fd211 commit ef9dda2

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/geo_combine/harvester.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def clone(repo = nil)
7373
return 0 if File.directory? repo_path
7474

7575
repo_url = "https://github.com/OpenGeoMetadata/#{repo}.git"
76-
Git.clone(repo_url, repo, path: repo_path, depth: 1) && 1
76+
Git.clone(repo_url, nil, path: ogm_path, depth: 1) && 1
7777
end
7878

7979
private

spec/lib/geo_combine/harvester_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@
7575
harvester.clone(repo_name)
7676
expect(Git).to have_received(:clone).with(
7777
repo_url,
78-
repo_name, {
78+
nil, {
7979
depth: 1, # shallow clone
80-
path: repo_path
80+
path: harvester.ogm_path
8181
}
8282
)
8383
end

0 commit comments

Comments
 (0)