From 0301c821c5cd124733accfbff0ddbf7f0b0ee9fb Mon Sep 17 00:00:00 2001 From: Brandon Williams Date: Thu, 17 Nov 2016 10:46:04 -0800 Subject: push: fix --dry-run to not push submodules Teach push to respect the --dry-run option when configured to recursively push submodules 'on-demand'. This is done by passing the --dry-run flag to the child process which performs a push for a submodules when performing a dry-run. In order to preserve good user experience, the additional check for unpushed submodules is skipped during a dry-run when --recurse-submodules=on-demand. The check is skipped because the submodule pushes were performed as dry-runs and this check would always fail as the submodules would still need to be pushed. Signed-off-by: Brandon Williams Signed-off-by: Junio C Hamano --- submodule.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'submodule.h') diff --git a/submodule.h b/submodule.h index 9454806dc5..23d76682b1 100644 --- a/submodule.h +++ b/submodule.h @@ -65,7 +65,9 @@ int merge_submodule(unsigned char result[20], const char *path, const unsigned c const unsigned char a[20], const unsigned char b[20], int search); int find_unpushed_submodules(struct sha1_array *commits, const char *remotes_name, struct string_list *needs_pushing); -int push_unpushed_submodules(struct sha1_array *commits, const char *remotes_name); +extern int push_unpushed_submodules(struct sha1_array *commits, + const char *remotes_name, + int dry_run); void connect_work_tree_and_git_dir(const char *work_tree, const char *git_dir); int parallel_submodules(void); -- cgit v1.3