From 9cbe7ba2f61552ce97fb312c8133813f970ab4a5 Mon Sep 17 00:00:00 2001 From: Francesco Placella Date: Tue, 31 Oct 2017 19:35:18 +0100 Subject: [PATCH] Fix #313: Ensured "-u" options is respected by "subrepo:push()". --- lib/git-subrepo | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/git-subrepo b/lib/git-subrepo index 68918cbe..bf76680c 100755 --- a/lib/git-subrepo +++ b/lib/git-subrepo @@ -665,11 +665,13 @@ subrepo:push() { git:delete-branch "$branch_name" fi - o "Put updates into '$subdir/.gitrepo' file." - upstream_head_commit="$new_upstream_head_commit" - subrepo_commit_ref="$upstream_head_commit" - update-gitrepo-file - RUN git commit -m "$(get-commit-message)" + if $update_wanted; then + o "Put updates into '$subdir/.gitrepo' file." + upstream_head_commit="$new_upstream_head_commit" + subrepo_commit_ref="$upstream_head_commit" + update-gitrepo-file + RUN git commit -m "$(get-commit-message)" + fi } # Fetch the subrepo's remote branch content: