Re: [PATCH] Do check_repository_format() early

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux