Skip to content

Commit

Permalink
Support subdir usage also on project scmsync
Browse files Browse the repository at this point in the history
We need to include the subdir used for the clone when
calculating the subdir to be used in the packages.
  • Loading branch information
mlschroe committed Dec 3, 2024
1 parent 8f34993 commit cc95e97
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions obs_scm_bridge
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ class ObsGit(object):
cmd += [ '--depth', '1' ]
if include_submodules:
# try to select specific submodule first when a subdir is given and fall back
if self.subdir is None or self.run_cmd_nonfatal(cmd + [ "--recurse-submodules=" + self.subdir ])[0] != 0:
if not self.subdir or self.run_cmd_nonfatal(cmd + [ "--recurse-submodules=" + self.subdir ])[0] != 0:
cmd += [ '--recurse-submodules' ]
self.run_cmd(cmd, fatal="git fetch")
else:
Expand Down Expand Up @@ -532,7 +532,10 @@ class ObsGit(object):
# add subdir parameter to url
url = self.url.copy()
query = urllib.parse.parse_qs(url[4])
query['subdir'] = subdir + directory
if self.subdir:
query['subdir'] = self.subdir + '/' + subdir + directory
else:
query['subdir'] = subdir + directory
url[4] = urllib.parse.urlencode(query)
if self.revision:
url[5] = self.revision
Expand Down

0 comments on commit cc95e97

Please sign in to comment.