Skip to content

Commit 6c779d0

Browse files
committed
scripts: Add smarter 'git add' logic in sync_pop_candidate.sh
Signed-off-by: timflannagan <[email protected]>
1 parent ba2dcd8 commit 6c779d0

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

scripts/common.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#! /bin/bash
22

33
export KNOWN_GENERATED_PATHS=(':!vendor' ':!pkg/manifests' ':!manifests' ':!go.sum' ':!go.mod')
4+
# TODO(tflannag): This is hacky but works in the current setup.
5+
export ROOT_GENERATED_PATHS=( "vendor" "pkg/manifests" "manifests" "go.mod" "go.sum" )
46
export UPSTREAM_REMOTES=("api" "operator-registry" "operator-lifecycle-manager")

scripts/sync_pop_candidate.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ cph=$(git rev-list -n 1 CHERRY_PICK_HEAD 2> /dev/null)
55
set -o errexit
66
set -o pipefail
77

8+
ROOT_DIR=$(dirname "${BASH_SOURCE[@]}")/..
9+
# shellcheck disable=SC1091
10+
source "${ROOT_DIR}/scripts/common.sh"
11+
812
pop_all=true
913

1014
set +u
@@ -56,7 +60,7 @@ function pop() {
5660
# 4. Remove from cherrypick set
5761
make vendor
5862
make manifests
59-
git add .
63+
git add "${subtree_dir}" "${ROOT_GENERATED_PATHS[@]}"
6064
git status
6165
git commit --amend --allow-empty --no-edit --trailer "Upstream-repository: ${remote}" --trailer "Upstream-commit: ${rc}"
6266

0 commit comments

Comments
 (0)