diff --git a/0001-Fix-clone-branches.patch b/0001-Fix-clone-branches.patch new file mode 100644 index 0000000..1536310 --- /dev/null +++ b/0001-Fix-clone-branches.patch @@ -0,0 +1,44 @@ +From c194bf503ffd176403708345a230501b634aa373 Mon Sep 17 00:00:00 2001 +From: Todd Zullinger +Date: Tue, 7 May 2019 21:40:31 -0400 +Subject: [PATCH] Fix clone --branches + +When cloning with the --branches option we first clone a bare repo +locally, then clone each branch from that bare repo. Avoid adding an +excludes file to the temporary bare repo (which fails because we pass +the wrong path to the git dir). Add an excludes file to each branch +dir. + +Resolves: rhbz#1707223 +Signed-off-by: Todd Zullinger +--- + pyrpkg/__init__.py | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/pyrpkg/__init__.py b/pyrpkg/__init__.py +index c12b52b..43bfc1d 100644 +--- a/pyrpkg/__init__.py ++++ b/pyrpkg/__init__.py +@@ -1546,7 +1546,8 @@ class Commands(object): + 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 @@ class Commands(object): + 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)) +-- +2.20.1 + diff --git a/rpkg.spec b/rpkg.spec index 6f80775..5d6180a 100644 --- a/rpkg.spec +++ b/rpkg.spec @@ -4,7 +4,7 @@ Name: rpkg Version: 1.58 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Python library for interacting with rpm+git License: GPLv2+ and LGPLv2 @@ -21,6 +21,7 @@ Source0: https://pagure.io/releases/rpkg/%{name}-%{version}.tar.gz # and there is only old rpm-python package in EL6 and 7, so just simply to # remove rpm-py-installer for now. Patch0: remove-koji-and-rpm-py-installer-from-requires.patch +Patch1: 0001-Fix-clone-branches.patch %if 0%{?fedora} || 0%{?rhel} > 7 # Enable python3 build by default @@ -261,6 +262,9 @@ nosetests tests %changelog +* Thu May 09 2019 Ondrej Nosek - 1.58-2 +- Backport: fixed 'clone --branch' command + * Mon Apr 29 2019 Ondřej Nosek - 1.58-1 - Ignore files in a cloned repository - #355 (onosek) - Handle data from python RPM binding as UTF-8 string (zebob.m)