| |
@@ -1546,7 +1546,8 @@
|
| |
conf_git = git.Git(os.path.join(path, git_dir))
|
| |
self._clone_config(conf_git, repo)
|
| |
|
| |
- self._add_git_excludes(os.path.join(path, git_dir))
|
| |
+ if not bare_dir:
|
| |
+ self._add_git_excludes(os.path.join(path, git_dir))
|
| |
|
| |
return
|
| |
|
| |
@@ -1625,6 +1626,9 @@
|
| |
branch_git.config("--replace-all",
|
| |
"remote.%s.url" % self.default_branch_remote,
|
| |
giturl)
|
| |
+
|
| |
+ # Add excludes
|
| |
+ self._add_git_excludes(branch_path)
|
| |
except (git.GitCommandError, OSError) as e:
|
| |
raise rpkgError('Could not locally clone %s from %s: %s'
|
| |
% (branch, repo_path, e))
|
| |
I marked this RFC because it lacks tests. I don't have the time at the moment to create proper tests, so perhaps someone else can add those.
I don't think there are any tests for
clone --branches
or this would have been found when da320b4 ("Ignore files in a cloned repository", 2019-04-15) was added. So ideally there would be a basic test for the branches option and then potentially another test to ensure that the excludes file is added to each branch dir.(Tangentially, I think the excludes patterns in fedpkg should be tightened up a bit, adding a leading
/
to anchor most of them at the root dir and a trailing/
toresults_*
to make it clear it's a directory.)