Skip to content

Commit 94ac9dd

Browse files
committed
Ensure option -u is respected by subrepo:push()
rebasing @plach79 ingydotnet#314 PR onto master
1 parent 5d6aba9 commit 94ac9dd

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
@@ -665,11 +665,13 @@ subrepo:push() {
665665
git:delete-branch "$branch_name"
666666
fi
667667

668-
o "Put updates into '$subdir/.gitrepo' file."
669-
upstream_head_commit="$new_upstream_head_commit"
670-
subrepo_commit_ref="$upstream_head_commit"
671-
update-gitrepo-file
672-
RUN git commit -m "$(get-commit-message)"
668+
if $update_wanted; then
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)"
674+
fi
673675
}
674676

675677
# Fetch the subrepo's remote branch content:

0 commit comments

Comments
 (0)