Skip to content

Commit de8e891

Browse files
ayaadmorgan
authored andcommitted
Ensure option -u is respected by subrepo:push()
rebasing @plach79 #314 PR onto master
1 parent 7cac75d commit de8e891

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

lib/git-subrepo

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -666,11 +666,13 @@ subrepo:push() {
666666
git:delete-branch "$branch_name"
667667
fi
668668

669-
o "Put updates into '$subdir/.gitrepo' file."
670-
upstream_head_commit="$new_upstream_head_commit"
671-
subrepo_commit_ref="$upstream_head_commit"
672-
update-gitrepo-file
673-
RUN git commit -m "$(get-commit-message)"
669+
if $update_wanted; then
670+
o "Put updates into '$subdir/.gitrepo' file."
671+
upstream_head_commit="$new_upstream_head_commit"
672+
subrepo_commit_ref="$upstream_head_commit"
673+
update-gitrepo-file
674+
RUN git commit -m "$(get-commit-message)"
675+
fi
674676
}
675677

676678
# Fetch the subrepo's remote branch content:

0 commit comments

Comments
 (0)