Re: [PATCH v3] sha1_file: do not add own object directory as alternate

2014-07-16 Thread Ephrim Khong
On 15.07.2014 21:26, Junio C Hamano wrote: + strbuf_addstr(objdirbuf, absolute_path(get_object_directory())); + normalize_path_copy(objdirbuf.buf, objdirbuf.buf); This is somewhat a strange usage of a strbuf. There might be a more elegant way, but I tried to mimic the local

Re: [PATCH v3] sha1_file: do not add own object directory as alternate

2014-07-16 Thread Ephrim Khong
On 15.07.2014 21:48, Junio C Hamano wrote: Ephrim Khong dr.kh...@gmail.com writes: +test_expect_success setup ' + GIT_OBJECT_DIRECTORY=.git//../.git/objects + export GIT_OBJECT_DIRECTORY Do you need this artificially strange environment settings for the problem to manifest

[PATCH v3] sha1_file: do not add own object directory as alternate

2014-07-15 Thread Ephrim Khong
When adding alternate object directories, we try not to add the directory of the current repository to avoid cycles. Unfortunately, that test was broken, since it compared an absolute with a relative path. Signed-off-by: Ephrim Khong dr.kh...@gmail.com --- Since v2: Added Johannes' comments.

Re: [PATCH v3] sha1_file: do not add own object directory as alternate

2014-07-15 Thread Junio C Hamano
Ephrim Khong dr.kh...@gmail.com writes: @@ -320,7 +320,7 @@ static int link_alt_odb_entry(const char *entry, const char *relative_base, int return -1; } } - if (!strcmp(ent-base, objdir)) { + if (!strcmp_icase(ent-base, normalized_objdir))

Re: [PATCH v3] sha1_file: do not add own object directory as alternate

2014-07-15 Thread Eric Sunshine
On Tue, Jul 15, 2014 at 7:29 AM, Ephrim Khong dr.kh...@gmail.com wrote: When adding alternate object directories, we try not to add the directory of the current repository to avoid cycles. Unfortunately, that test was broken, since it compared an absolute with a relative path.

Re: [PATCH v3] sha1_file: do not add own object directory as alternate

2014-07-15 Thread Junio C Hamano
Ephrim Khong dr.kh...@gmail.com writes: diff --git a/t/t7702-repack-cyclic-alternate.sh b/t/t7702-repack-cyclic-alternate.sh new file mode 100755 index 000..8341d46 --- /dev/null +++ b/t/t7702-repack-cyclic-alternate.sh @@ -0,0 +1,24 @@ +#!/bin/sh +# +# Copyright (c) 2014 Ephrim