Skip to content

Commit

Permalink
try get_default_branch_name
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmad-el-sayed committed Oct 8, 2024
1 parent e37ce23 commit fda67fc
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions scripts/manage_docker_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ function docker_pull() {

function get_default_branch_name() {
local repo_path="$1"
#git -C ${repo_path} fetch --unshallow
git -C ${repo_path} fetch --depth=10000
git -C ${repo_path} fetch --all
git -C ${repo_path} remote set-head origin --auto
Expand All @@ -214,7 +213,6 @@ function get_default_branch_name() {

function get_parent_branch_name() {
local repo_path="$1"
#git -C ${repo_path} fetch --unshallow
git -C ${repo_path} fetch --depth=10000
git -C ${repo_path} fetch --all
git -C ${repo_path} remote set-head origin --auto
Expand Down Expand Up @@ -256,8 +254,8 @@ function manage_docker_image() {

local full_docker_image_name="${server_address}/${project_path}/${docker_image_name}:${docker_image_tag}"

local parent_branch=$(get_parent_branch_name "${repo_path}")
#local parent_branch=$(get_default_branch_name "${repo_path}")
#local parent_branch=$(get_parent_branch_name "${repo_path}")
local parent_branch=$(get_default_branch_name "${repo_path}")
echo "Parent branch: ${parent_branch}"
if has_git_diffs "${repo_path}" "${parent_branch}" files_to_check[@]; then
echo "Image will be built and pushed"
Expand Down

0 comments on commit fda67fc

Please sign in to comment.