From: Fredrik Gustafsson <iveqy@iveqy.com>
To: git@vger.kernel.org
Cc: gitster@pobox.com, iveqy@iveqy.com, hvoigt@hvoigt.net,
jens.lehmann@web.de
Subject: [RFC 1/2] test whether push checks for unpushed remotes in submodules
Date: Sun, 26 Jun 2011 20:29:46 +0200 [thread overview]
Message-ID: <1309112987-3185-2-git-send-email-iveqy@iveqy.com> (raw)
In-Reply-To: <1309112987-3185-1-git-send-email-iveqy@iveqy.com>
From: Heiko Voigt <hvoigt@hvoigt.net>
These tests are used to extend push to check whether all recorded
submodule commits have also been pushed.
Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
---
t/t5531-deep-submodule-push.sh | 46 +++++++++++++++++++++++++++++++++++++++-
1 files changed, 45 insertions(+), 1 deletions(-)
diff --git a/t/t5531-deep-submodule-push.sh b/t/t5531-deep-submodule-push.sh
index faa2e96..0b55466 100755
--- a/t/t5531-deep-submodule-push.sh
+++ b/t/t5531-deep-submodule-push.sh
@@ -28,8 +28,52 @@ test_expect_success setup '
test_expect_success push '
(
cd work &&
- git push ../pub.git master
+ git push -f ../pub.git master
)
'
+test_expect_failure 'push fails if submodule has no remote' '
+ (
+ cd work/gar/bage &&
+ >junk2 &&
+ git add junk2 &&
+ git commit -m "Second junk"
+ ) &&
+ (
+ cd work &&
+ git add gar/bage &&
+ git commit -m "Second commit for gar/bage" &&
+ test_must_fail git push ../pub.git master
+ )
+'
+
+test_expect_failure 'push fails if submodule commit not on remote' '
+ (
+ cd work/gar &&
+ git clone --bare bage ../../submodule.git &&
+ cd bage &&
+ git remote add origin ../../../submodule.git &&
+ git fetch &&
+ >junk3 &&
+ git add junk3 &&
+ git commit -m "Third junk"
+ ) &&
+ (
+ cd work &&
+ git add gar/bage &&
+ git commit -m "Third commit for gar/bage" &&
+ test_must_fail git push ../pub.git master
+ )
+'
+
+test_expect_failure 'push succeeds after commit was pushed to remote' '
+ (
+ cd work/gar/bage &&
+ git push origin master
+ ) &&
+ (
+ cd work &&
+ git push ../pub.git master
+ )
+'
test_done
--
1.7.6.rc3.2.g0185a
next prev parent reply other threads:[~2011-06-26 18:32 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-26 18:29 [RFC 0/2] push checks for unpushed remotes in submodules Fredrik Gustafsson
2011-06-26 18:29 ` Fredrik Gustafsson [this message]
2011-06-26 18:29 ` [RFC 2/2] Don't push a repository with unpushed submodules Fredrik Gustafsson
2011-06-28 18:29 ` Junio C Hamano
2011-06-28 19:30 ` Heiko Voigt
2011-06-28 20:43 ` Junio C Hamano
2011-06-28 21:59 ` Fredrik Gustafsson
2011-06-28 22:24 ` Jens Lehmann
2011-07-04 20:05 ` Heiko Voigt
2011-06-28 22:06 ` Marc Branchaud
2011-06-28 22:32 ` Jens Lehmann
2011-06-29 17:29 ` Marc Branchaud
2011-06-28 23:02 ` Fredrik Gustafsson
2011-06-29 17:34 ` Marc Branchaud
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1309112987-3185-2-git-send-email-iveqy@iveqy.com \
--to=iveqy@iveqy.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=hvoigt@hvoigt.net \
--cc=jens.lehmann@web.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).