aboutsummaryrefslogtreecommitdiff
path: root/transport.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-09-02 13:07:58 -0700
committerJunio C Hamano <gitster@pobox.com>2011-09-02 13:07:58 -0700
commitc63750abc30c017d13d6be9e5a90d6d2c56b60b6 (patch)
tree5c1b9704a3e4404fd330153bc5dc8fa5da35b621 /transport.c
parent497dff9138189b405016ff9e1f96554f1c44b1e7 (diff)
parentd2b17b3220cbd75b1c8e2aa6cfdc5c121749c97d (diff)
downloadgit-c63750abc30c017d13d6be9e5a90d6d2c56b60b6.tar.gz
git-c63750abc30c017d13d6be9e5a90d6d2c56b60b6.tar.xz
Merge branch 'fg/submodule-ff-check-before-push'
* fg/submodule-ff-check-before-push: push: Don't push a repository with unpushed submodules
Diffstat (limited to 'transport.c')
-rw-r--r--transport.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/transport.c b/transport.c
index 98c577804..d2725e57d 100644
--- a/transport.c
+++ b/transport.c
@@ -10,6 +10,7 @@
#include "refs.h"
#include "branch.h"
#include "url.h"
+#include "submodule.h"
/* rsync support */
@@ -1045,6 +1046,14 @@ int transport_push(struct transport *transport,
flags & TRANSPORT_PUSH_MIRROR,
flags & TRANSPORT_PUSH_FORCE);
+ if ((flags & TRANSPORT_RECURSE_SUBMODULES_CHECK) && !is_bare_repository()) {
+ struct ref *ref = remote_refs;
+ for (; ref; ref = ref->next)
+ if (!is_null_sha1(ref->new_sha1) &&
+ check_submodule_needs_pushing(ref->new_sha1,transport->remote->name))
+ die("There are unpushed submodules, aborting.");
+ }
+
push_ret = transport->push_refs(transport, remote_refs, flags);
err = push_had_errors(remote_refs);
ret = push_ret | err;