public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
To: git-commits@fedoraproject.org
Subject: [rpms/rpkg] 1.70-1: Backport: fixed 'clone --branch' command
Date: Mon, 10 Aug 2026 21:44:03 GMT	[thread overview]
Message-ID: <178639824388.1.10850554433646775895.rpms-rpkg-67075c4b40de@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/rpkg
            Branch : 1.70-1
            Commit : 67075c4b40de8579c1ab0e09a5ca74a4cea81f3b
            Author : Ondřej Nosek <onosek@redhat.com>
            Date   : 2019-05-09T15:12:02+00:00
            Stats  : +49/-1 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/rpkg/c/67075c4b40de8579c1ab0e09a5ca74a4cea81f3b?branch=1.70-1

            Log:
            Backport: fixed 'clone --branch' command

Signed-off-by: Ondřej Nosek <onosek@redhat.com>

---
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 <tmz@pobox.com>
+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 <tmz@pobox.com>
+---
+ 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 <onosek@redhat.com> - 1.58-2
+- Backport: fixed 'clone --branch' command
+
 * Mon Apr 29 2019 Ondřej Nosek <onosek@redhat.com> - 1.58-1
 - Ignore files in a cloned repository - #355 (onosek)
 - Handle data from python RPM binding as UTF-8 string (zebob.m)

                 reply	other threads:[~2026-08-10 21:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178639824388.1.10850554433646775895.rpms-rpkg-67075c4b40de@fedoraproject.org \
    --to=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox