git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 1/3] test whether push checks for unpushed remotes in submodules

From
Fredrik Gustafsson <iveqy@iveqy.com>
Date
Jul 27, 2011, 18:10 UTC
Message-ID
<1311790250-32454-2-git-send-email-iveqy@iveqy.com>
In-Reply-To
<1311790250-32454-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.236.g7ad21
Previous: Fredrik GustafssonNext: Fredrik Gustafsson
Message 2 of 10 in “check for unpushed remotes in submodules”
  1. 0/3 check for unpushed remotes in submodulesFredrik Gustafsson, Jul 27, 2011
  2. 1/3 test whether push checks for unpushed remotes in submodulesFredrik Gustafsson, Jul 27, 2011
  3. 2/3 push: Don't push a repository with unpushed submodulesFredrik Gustafsson, Jul 27, 2011
  4. 3/3 push: Add the --no-recurse-submodules optionFredrik Gustafsson, Jul 27, 2011
  5. Junio C HamanoJul 28, 2011
  6. Jens LehmannJul 28, 2011
  7. Jens LehmannJul 29, 2011
  8. Junio C HamanoAug 1, 2011
  9. Junio C HamanoJul 28, 2011
  10. Jens LehmannJul 28, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.