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

Re: [PATCH] clone: fix options '-o' and '--origin' to be recognised again

From
Jeff King <peff@peff.net>
Date
Dec 19, 2007, 15:43 UTC
Message-ID
<20071219154350.GC13942@coredump.intra.peff.net>
In-Reply-To
<20071219091515.GA20707@fiberbit.xs4all.nl>
On Wed, Dec 19, 2007 at 10:15:15AM +0100, Marco Roeland wrote:
>  This is a regression in 'next', introduced on Nov 4th by commit 94362599
>  "Migrate git-clone to use git-rev-parse --parseopt". Added Kristian as
>  he works on the builtin version; perhaps nice for a test case (!).

Here is a test case that catches this regression. It can perhaps be expanded by Kristian to test other options, but is probably worth adding now as a basic sanity check.

I put the test in 5702. There seems to be a '5600' clone test, as well, which perhaps should be in the 57?? series.

-- >8 -- test "git clone -o"

This tests a recently fixed regression in which "git clone -o" didn't work at all.

Signed-off-by: Jeff King <peff@peff.net>
---
 t/t5702-clone-options.sh |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)
 create mode 100755 t/t5702-clone-options.sh
diff --git a/t/t5702-clone-options.sh b/t/t5702-clone-options.sh
new file mode 100755
index 0000000..328e4d9
--- /dev/null
+++ b/t/t5702-clone-options.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+test_description='basic clone options'
+. ./test-lib.sh
+
+test_expect_success 'setup' '
+
+	mkdir parent &&
+	(cd parent && git init &&
+	 echo one >file && git add file &&
+	 git commit -m one)
+
+'
+
+test_expect_success 'clone -o' '
+
+	git clone -o foo parent clone-o &&
+	(cd clone-o && git rev-parse --verify refs/remotes/foo/master)
+
+'
+
+test_done
-- 
1.5.4.rc0.1162.gaa83ae
Previous: Junio C Hamano
Message 3 of 3 in “clone: fix options '-o' and '--origin' to be recognised again”
  1. clone: fix options '-o' and '--origin' to be recognised againMarco Roeland, Dec 19, 2007
  2. Junio C HamanoDec 19, 2007
  3. Jeff KingDec 19, 2007

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.