Home Home > GIT Browse > scripts
diff options
authorOlaf Hering <ohering@suse.de>2019-07-16 15:33:46 +0200
committerOlaf Hering <ohering@suse.de>2019-07-16 15:33:46 +0200
commitb98fb06811e9a46c4e485ae481217e77e26d3524 (patch)
parent9d16ecd982eab5ca709eeed172c2309d6b2e9d00 (diff)
scripts/tar-up.sh: do not make assumptions about the remote name (bsc#1141488)
The script assumed a remote named 'origin' exists. While this is true for cloning a repo with default options, the name of the remote can be easily changed. Also there can be more than one remotes. Extend the script to exclude a branch named 'scripts' in all configured remotes.
1 files changed, 6 insertions, 3 deletions
diff --git a/scripts/tar-up.sh b/scripts/tar-up.sh
index 9e5ece204b..aaae2d176e 100755
--- a/scripts/tar-up.sh
+++ b/scripts/tar-up.sh
@@ -225,9 +225,12 @@ elif $using_git; then
# users of the rpm packages.
# FIXME: the remote might have a different name than "origin" or there
# might be no remote at all.
- if git cat-file -e origin/scripts 2>/dev/null; then
- exclude[${#exclude[@]}]=^origin/scripts
- fi
+ for remote in $(git remote)
+ do
+ if git cat-file -e ${remote}/scripts 2>/dev/null; then
+ exclude[${#exclude[@]}]=^${remote}/scripts
+ fi
+ done
if git cat-file -e scripts 2>/dev/null; then