summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2019-09-25 10:33:06 -0400
committerPanu Matilainen <pmatilai@redhat.com>2022-03-31 10:07:40 +0300
commit3a6b1d8fbf846d3f1b139d343fdfddebe99ae42b (patch)
tree2ed28284a08da00d132a0625dabd14a95a49fa8b
parentfa70eca360e39d61504d1c33079892706f2f8af6 (diff)
downloadrpm-3a6b1d8fbf846d3f1b139d343fdfddebe99ae42b.tar.gz
Make "%autosetup -S git" and "%autosetup -S git_am" work on a branch.
This changes the git autosetup handlers so that they do the initial commit of the expanded tarball on "master", then switch to a branch "rpm-build" before applying patches. Additionally it sets the "rpm-build" branch's upstream to "master", so that in the active work tree where the "rpm-build" is checked out, commands such as "git rebase -i" automatically have a default behavior that makes sense. Signed-off-by: Peter Jones <pjones@redhat.com>
-rw-r--r--macros.in5
1 files changed, 4 insertions, 1 deletions
diff --git a/macros.in b/macros.in
index 3d6862906..6177e6fec 100644
--- a/macros.in
+++ b/macros.in
@@ -1172,7 +1172,10 @@ package or when debugging this package.\
%{__git} config gc.auto 0\
%{__git} add --force .\
%{__git} commit %{-q} --allow-empty -a\\\
- --author "%{__scm_author}" -m "%{NAME}-%{VERSION} base"
+ --author "%{__scm_author}" -m "%{NAME}-%{VERSION} base"\
+%{__git} branch rpm-build \
+%{__git} checkout rpm-build \
+%{__git} branch --set-upstream-to=master
%__scm_apply_git(qp:m:)\
%{__git} apply --index --reject %{-p:-p%{-p*}} -\