Skip to content

Commit 5515ead

Browse files
authored
Merge pull request #624 from yuvalk/main
Infer the git remote from the branch name
2 parents 0e45daa + 013197f commit 5515ead

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,15 @@ EXTRA_PLAYBOOK_OPTS ?=
2525
# INDEX_IMAGES=registry-proxy.engineering.redhat.com/rh-osbs/iib:394248,registry-proxy.engineering.redhat.com/rh-osbs/iib:394249
2626
INDEX_IMAGES ?=
2727

28-
TARGET_ORIGIN ?= origin
2928
# This is to ensure that whether we start with a git@ or https:// URL, we end up with an https:// URL
3029
# This is because we expect to use tokens for repo authentication as opposed to SSH keys
3130
TARGET_REPO=$(shell git ls-remote --get-url --symref $(TARGET_ORIGIN) | sed -e 's/.*URL:[[:space:]]*//' -e 's%^git@%%' -e 's%^https://%%' -e 's%:%/%' -e 's%^%https://%')
3231
# git branch --show-current is also available as of git 2.22, but we will use this for compatibility
3332
TARGET_BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)
3433

34+
#default to the branch remote
35+
TARGET_ORIGIN ?= $(shell git config branch.$(TARGET_BRANCH).remote)
36+
3537
UUID_FILE ?= ~/.config/validated-patterns/pattern-uuid
3638
UUID_HELM_OPTS ?=
3739

0 commit comments

Comments
 (0)