Skip to content

Commit 4c5b49a

Browse files
authored
added flags to push subtree branch to github remote repo
1 parent 68dcebb commit 4c5b49a

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

slice.sh

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,16 @@ for _i in "${@}" ; do
1818

1919
done
2020

21-
readarray -t _git_branches < <(git branch --list "${_git_subtree_branch_prefix}*")
21+
if [[ -n "${ENABLE_SUBTREE_PUSH}" ]] ; then
2222

23-
for _i in "${_git_branches[@]}" ; do
23+
readarray -t _git_branches < <(git branch --list "${_git_subtree_branch_prefix}*")
2424

25-
_git_subtree_branch="${_i}"
26-
_git_remote_repo_name="${_git_subtree_branch#${_git_subtree_branch_prefix}}"
27-
git push "https://x-access-token:${ACCESS_TOKEN}@github.com/${GITHUB_OWNER}/${_git_remote_repo_name}.git" "${_git_subtree_branch}:${_git_branch}"
25+
for _i in "${_git_branches[@]}" ; do
2826

29-
done
27+
_git_subtree_branch="${_i}"
28+
_git_remote_repo_name="${_git_subtree_branch#${_git_subtree_branch_prefix}}"
29+
git push "https://x-access-token:${ACCESS_TOKEN}@github.com/${GITHUB_OWNER}/${_git_remote_repo_name}.git" "${_git_subtree_branch}:${_git_branch}"
30+
31+
done
32+
33+
fi

0 commit comments

Comments
 (0)