Thread (4 messages) flat view 4 messages, 3 authors, 2016-06-15

Re: [PATCH] Do check_repository_format() early

From: Johannes Schindelin <hidden>
Date: 2016-06-15 22:43:55

Hi,

On Mon, 3 Dec 2007, Nguyen Thai Ngoc Duy wrote:
The patch's behaviour is barf if the repository version is too new.
The list of files that use setup_git_directory_gently is not long. I
am going to have a look over the files before amending the patch again
to make it only barf if nongit_ok is NULL.
In the interest of least surprise, _gently() should not ignore a too new 
repository format.  It is also keeping the semantics simpler, which is 
good for users like me.

So I'd test it with "git apply", just because it is the first on the list.  
Something like

-- snip --
cat > patch << EOF
diff a/empty-file b/empty-file
--- a/empty-file
+++ b/empty-file
@@ -0,0 +1,1 @@
+narf
EOF

test_expect_success '_gently() respects repositoryversion' '

	mkdir way_too_new &&
	(cd way_too_new &&
	 git init &&
	 git config core.repositoryFormatVersion 999999 &&
	 : > empty-file &&
	 ! git apply < ../patch 2> error.out &&
	 grep "git repo version" error.out &&
	 ! test -s empty-file

'
-- snap --

Hmm?

Ciao,
Dscho
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help