Compare commits
38 Commits
v2.11.0-rc
...
v2.11.0-rc
Author | SHA1 | Date | |
---|---|---|---|
3ab228137f | |||
371811751d | |||
12133d52c1 | |||
7f2a3921fb | |||
332fd5655a | |||
5de732f647 | |||
b18f6a0066 | |||
f5a8ad4c5a | |||
dfbfb9f377 | |||
a0d8b60da8 | |||
fdf4f6c79b | |||
71dd50472d | |||
3285b7badb | |||
a7d6bcc329 | |||
b36b716cf6 | |||
3b03097d66 | |||
0538b84027 | |||
7b2c338cae | |||
81cf0b6c7e | |||
c1e0dc59bd | |||
a296bc0132 | |||
f01fe92b82 | |||
2ae38f2a65 | |||
734fde2d71 | |||
37a95862c6 | |||
ec2e8b3da2 | |||
038212c4c4 | |||
4821494ebc | |||
f272696a35 | |||
30030a36b6 | |||
cbb6707b11 | |||
be5a750939 | |||
bf2f63a781 | |||
e828d33316 | |||
bcb4425216 | |||
753c451501 | |||
c2bb0c1d1e | |||
3e98919a18 |
@ -32,7 +32,6 @@ env:
|
|||||||
- DEFAULT_TEST_TARGET=prove
|
- DEFAULT_TEST_TARGET=prove
|
||||||
- GIT_PROVE_OPTS="--timer --jobs 3 --state=failed,slow,save"
|
- GIT_PROVE_OPTS="--timer --jobs 3 --state=failed,slow,save"
|
||||||
- GIT_TEST_OPTS="--verbose-log"
|
- GIT_TEST_OPTS="--verbose-log"
|
||||||
- GIT_TEST_HTTPD=true
|
|
||||||
- GIT_TEST_CLONE_2GB=YesPlease
|
- GIT_TEST_CLONE_2GB=YesPlease
|
||||||
# t9810 occasionally fails on Travis CI OS X
|
# t9810 occasionally fails on Travis CI OS X
|
||||||
# t9816 occasionally fails with "TAP out of sequence errors" on Travis CI OS X
|
# t9816 occasionally fails with "TAP out of sequence errors" on Travis CI OS X
|
||||||
@ -57,6 +56,8 @@ before_install:
|
|||||||
- >
|
- >
|
||||||
case "${TRAVIS_OS_NAME:-linux}" in
|
case "${TRAVIS_OS_NAME:-linux}" in
|
||||||
linux)
|
linux)
|
||||||
|
export GIT_TEST_HTTPD=YesPlease
|
||||||
|
|
||||||
mkdir --parents custom/p4
|
mkdir --parents custom/p4
|
||||||
pushd custom/p4
|
pushd custom/p4
|
||||||
wget --quiet http://filehost.perforce.com/perforce/r$LINUX_P4_VERSION/bin.linux26x86_64/p4d
|
wget --quiet http://filehost.perforce.com/perforce/r$LINUX_P4_VERSION/bin.linux26x86_64/p4d
|
||||||
|
@ -21,7 +21,7 @@ Backward compatibility notes.
|
|||||||
|
|
||||||
* The default abbreviation length, which has historically been 7, now
|
* The default abbreviation length, which has historically been 7, now
|
||||||
scales as the repository grows, using the approximate number of
|
scales as the repository grows, using the approximate number of
|
||||||
objects in the reopsitory and a bit of math around the birthday
|
objects in the repository and a bit of math around the birthday
|
||||||
paradox. The logic suggests to use 12 hexdigits for the Linux
|
paradox. The logic suggests to use 12 hexdigits for the Linux
|
||||||
kernel, and 9 to 10 for Git itself.
|
kernel, and 9 to 10 for Git itself.
|
||||||
|
|
||||||
@ -45,10 +45,10 @@ UI, Workflows & Features
|
|||||||
which was not intuitive, given that "git nosuchcommand" said "git:
|
which was not intuitive, given that "git nosuchcommand" said "git:
|
||||||
'nosuchcommand' is not a git command".
|
'nosuchcommand' is not a git command".
|
||||||
|
|
||||||
* "git clone --resurse-submodules --reference $path $URL" is a way to
|
* "git clone --recurse-submodules --reference $path $URL" is a way to
|
||||||
reduce network transfer cost by borrowing objects in an existing
|
reduce network transfer cost by borrowing objects in an existing
|
||||||
$path repository when cloning the superproject from $URL; it
|
$path repository when cloning the superproject from $URL; it
|
||||||
learned to also peek into $path for presense of corresponding
|
learned to also peek into $path for presence of corresponding
|
||||||
repositories of submodules and borrow objects from there when able.
|
repositories of submodules and borrow objects from there when able.
|
||||||
|
|
||||||
* The "git diff --submodule={short,log}" mechanism has been enhanced
|
* The "git diff --submodule={short,log}" mechanism has been enhanced
|
||||||
@ -73,7 +73,7 @@ UI, Workflows & Features
|
|||||||
|
|
||||||
* In some projects, it is common to use "[RFC PATCH]" as the subject
|
* In some projects, it is common to use "[RFC PATCH]" as the subject
|
||||||
prefix for a patch meant for discussion rather than application. A
|
prefix for a patch meant for discussion rather than application. A
|
||||||
new option "--rfc" was a short-hand for "--subject-prefix=RFC PATCH"
|
new option "--rfc" is a short-hand for "--subject-prefix=RFC PATCH"
|
||||||
to help the participants of such projects.
|
to help the participants of such projects.
|
||||||
|
|
||||||
* "git add --chmod=+x <pathspec>" added recently only toggled the
|
* "git add --chmod=+x <pathspec>" added recently only toggled the
|
||||||
@ -96,8 +96,8 @@ UI, Workflows & Features
|
|||||||
|
|
||||||
* When given an abbreviated object name that is not (or more
|
* When given an abbreviated object name that is not (or more
|
||||||
realistically, "no longer") unique, we gave a fatal error
|
realistically, "no longer") unique, we gave a fatal error
|
||||||
"ambiguous argument". This error is now accompanied by hints that
|
"ambiguous argument". This error is now accompanied by a hint that
|
||||||
lists the objects that begins with the given prefix. During the
|
lists the objects beginning with the given prefix. During the
|
||||||
course of development of this new feature, numerous minor bugs were
|
course of development of this new feature, numerous minor bugs were
|
||||||
uncovered and corrected, the most notable one of which is that we
|
uncovered and corrected, the most notable one of which is that we
|
||||||
gave "short SHA1 xxxx is ambiguous." twice without good reason.
|
gave "short SHA1 xxxx is ambiguous." twice without good reason.
|
||||||
@ -330,7 +330,7 @@ notes for details).
|
|||||||
* "git diff -W" output needs to extend the context backward to
|
* "git diff -W" output needs to extend the context backward to
|
||||||
include the header line of the current function and also forward to
|
include the header line of the current function and also forward to
|
||||||
include the body of the entire current function up to the header
|
include the body of the entire current function up to the header
|
||||||
line of the next one. This process may have to merge to adjacent
|
line of the next one. This process may have to merge two adjacent
|
||||||
hunks, but the code forgot to do so in some cases.
|
hunks, but the code forgot to do so in some cases.
|
||||||
|
|
||||||
* Performance tests done via "t/perf" did not use the same set of
|
* Performance tests done via "t/perf" did not use the same set of
|
||||||
@ -568,6 +568,12 @@ notes for details).
|
|||||||
prefixing $(git --exec-path) output in front.
|
prefixing $(git --exec-path) output in front.
|
||||||
(merge 1073094f30 ak/sh-setup-dot-source-i18n-fix later to maint).
|
(merge 1073094f30 ak/sh-setup-dot-source-i18n-fix later to maint).
|
||||||
|
|
||||||
|
* Fix for a racy false-positive test failure.
|
||||||
|
(merge fdf4f6c79b as/merge-attr-sleep later to maint).
|
||||||
|
|
||||||
|
* Portability update and workaround for builds on recent Mac OS X.
|
||||||
|
(merge a296bc0132 ls/macos-update later to maint).
|
||||||
|
|
||||||
* Other minor doc, test and build updates and code cleanups.
|
* Other minor doc, test and build updates and code cleanups.
|
||||||
(merge 5c238e29a8 jk/common-main later to maint).
|
(merge 5c238e29a8 jk/common-main later to maint).
|
||||||
(merge 5a5749e45b ak/pre-receive-hook-template-modefix later to maint).
|
(merge 5a5749e45b ak/pre-receive-hook-template-modefix later to maint).
|
||||||
@ -575,3 +581,5 @@ notes for details).
|
|||||||
(merge de9f7fa3b0 rs/commit-pptr-simplify later to maint).
|
(merge de9f7fa3b0 rs/commit-pptr-simplify later to maint).
|
||||||
(merge 4259d693fc sc/fmt-merge-msg-doc-markup-fix later to maint).
|
(merge 4259d693fc sc/fmt-merge-msg-doc-markup-fix later to maint).
|
||||||
(merge 28fab7b23d nd/test-helpers later to maint).
|
(merge 28fab7b23d nd/test-helpers later to maint).
|
||||||
|
(merge c2bb0c1d1e rs/cocci later to maint).
|
||||||
|
(merge 3285b7badb ps/common-info-doc later to maint).
|
||||||
|
@ -177,7 +177,7 @@ sharedindex.<SHA-1>::
|
|||||||
info::
|
info::
|
||||||
Additional information about the repository is recorded
|
Additional information about the repository is recorded
|
||||||
in this directory. This directory is ignored if $GIT_COMMON_DIR
|
in this directory. This directory is ignored if $GIT_COMMON_DIR
|
||||||
is set and "$GIT_COMMON_DIR/index" will be used instead.
|
is set and "$GIT_COMMON_DIR/info" will be used instead.
|
||||||
|
|
||||||
info/refs::
|
info/refs::
|
||||||
This file helps dumb transports discover what refs are
|
This file helps dumb transports discover what refs are
|
||||||
|
1
Makefile
1
Makefile
@ -1047,6 +1047,7 @@ ifeq ($(uname_S),Darwin)
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
ifndef NO_APPLE_COMMON_CRYPTO
|
ifndef NO_APPLE_COMMON_CRYPTO
|
||||||
|
NO_OPENSSL = YesPlease
|
||||||
APPLE_COMMON_CRYPTO = YesPlease
|
APPLE_COMMON_CRYPTO = YesPlease
|
||||||
COMPAT_CFLAGS += -DAPPLE_COMMON_CRYPTO
|
COMPAT_CFLAGS += -DAPPLE_COMMON_CRYPTO
|
||||||
endif
|
endif
|
||||||
|
@ -17,10 +17,13 @@ expression E1;
|
|||||||
+ oid_to_hex(&E1)
|
+ oid_to_hex(&E1)
|
||||||
|
|
||||||
@@
|
@@
|
||||||
|
identifier f != oid_to_hex;
|
||||||
expression E1;
|
expression E1;
|
||||||
@@
|
@@
|
||||||
|
f(...) {...
|
||||||
- sha1_to_hex(E1->hash)
|
- sha1_to_hex(E1->hash)
|
||||||
+ oid_to_hex(E1)
|
+ oid_to_hex(E1)
|
||||||
|
...}
|
||||||
|
|
||||||
@@
|
@@
|
||||||
expression E1, E2;
|
expression E1, E2;
|
||||||
@ -29,10 +32,13 @@ expression E1, E2;
|
|||||||
+ oid_to_hex_r(E1, &E2)
|
+ oid_to_hex_r(E1, &E2)
|
||||||
|
|
||||||
@@
|
@@
|
||||||
|
identifier f != oid_to_hex_r;
|
||||||
expression E1, E2;
|
expression E1, E2;
|
||||||
@@
|
@@
|
||||||
|
f(...) {...
|
||||||
- sha1_to_hex_r(E1, E2->hash)
|
- sha1_to_hex_r(E1, E2->hash)
|
||||||
+ oid_to_hex_r(E1, E2)
|
+ oid_to_hex_r(E1, E2)
|
||||||
|
...}
|
||||||
|
|
||||||
@@
|
@@
|
||||||
expression E1;
|
expression E1;
|
||||||
@ -41,10 +47,13 @@ expression E1;
|
|||||||
+ oidclr(&E1)
|
+ oidclr(&E1)
|
||||||
|
|
||||||
@@
|
@@
|
||||||
|
identifier f != oidclr;
|
||||||
expression E1;
|
expression E1;
|
||||||
@@
|
@@
|
||||||
|
f(...) {...
|
||||||
- hashclr(E1->hash)
|
- hashclr(E1->hash)
|
||||||
+ oidclr(E1)
|
+ oidclr(E1)
|
||||||
|
...}
|
||||||
|
|
||||||
@@
|
@@
|
||||||
expression E1, E2;
|
expression E1, E2;
|
||||||
@ -53,10 +62,13 @@ expression E1, E2;
|
|||||||
+ oidcmp(&E1, &E2)
|
+ oidcmp(&E1, &E2)
|
||||||
|
|
||||||
@@
|
@@
|
||||||
|
identifier f != oidcmp;
|
||||||
expression E1, E2;
|
expression E1, E2;
|
||||||
@@
|
@@
|
||||||
|
f(...) {...
|
||||||
- hashcmp(E1->hash, E2->hash)
|
- hashcmp(E1->hash, E2->hash)
|
||||||
+ oidcmp(E1, E2)
|
+ oidcmp(E1, E2)
|
||||||
|
...}
|
||||||
|
|
||||||
@@
|
@@
|
||||||
expression E1, E2;
|
expression E1, E2;
|
||||||
@ -77,10 +89,13 @@ expression E1, E2;
|
|||||||
+ oidcpy(&E1, &E2)
|
+ oidcpy(&E1, &E2)
|
||||||
|
|
||||||
@@
|
@@
|
||||||
|
identifier f != oidcpy;
|
||||||
expression E1, E2;
|
expression E1, E2;
|
||||||
@@
|
@@
|
||||||
|
f(...) {...
|
||||||
- hashcpy(E1->hash, E2->hash)
|
- hashcpy(E1->hash, E2->hash)
|
||||||
+ oidcpy(E1, E2)
|
+ oidcpy(E1, E2)
|
||||||
|
...}
|
||||||
|
|
||||||
@@
|
@@
|
||||||
expression E1, E2;
|
expression E1, E2;
|
||||||
|
@ -240,7 +240,7 @@ static enum ack_type get_ack(int fd, unsigned char *result_sha1)
|
|||||||
return ACK;
|
return ACK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
die(_("git fetch_pack: expected ACK/NAK, got '%s'"), line);
|
die(_("git fetch-pack: expected ACK/NAK, got '%s'"), line);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void send_request(struct fetch_pack_args *args,
|
static void send_request(struct fetch_pack_args *args,
|
||||||
|
@ -629,7 +629,7 @@ static const char *todo_command_strings[] = {
|
|||||||
|
|
||||||
static const char *command_to_string(const enum todo_command command)
|
static const char *command_to_string(const enum todo_command command)
|
||||||
{
|
{
|
||||||
if (command < ARRAY_SIZE(todo_command_strings))
|
if ((size_t)command < ARRAY_SIZE(todo_command_strings))
|
||||||
return todo_command_strings[command];
|
return todo_command_strings[command];
|
||||||
die("Unknown command: %d", command);
|
die("Unknown command: %d", command);
|
||||||
}
|
}
|
||||||
|
@ -296,7 +296,7 @@ static int link_alt_odb_entry(const char *entry, const char *relative_base,
|
|||||||
}
|
}
|
||||||
strbuf_addstr(&pathbuf, entry);
|
strbuf_addstr(&pathbuf, entry);
|
||||||
|
|
||||||
if (strbuf_normalize_path(&pathbuf) < 0) {
|
if (strbuf_normalize_path(&pathbuf) < 0 && relative_base) {
|
||||||
error("unable to normalize alternate object path: %s",
|
error("unable to normalize alternate object path: %s",
|
||||||
pathbuf.buf);
|
pathbuf.buf);
|
||||||
strbuf_release(&pathbuf);
|
strbuf_release(&pathbuf);
|
||||||
|
@ -510,7 +510,8 @@ const char *find_unique_abbrev(const unsigned char *sha1, int len)
|
|||||||
{
|
{
|
||||||
static int bufno;
|
static int bufno;
|
||||||
static char hexbuffer[4][GIT_SHA1_HEXSZ + 1];
|
static char hexbuffer[4][GIT_SHA1_HEXSZ + 1];
|
||||||
char *hex = hexbuffer[3 & ++bufno];
|
char *hex = hexbuffer[bufno];
|
||||||
|
bufno = (bufno + 1) % ARRAY_SIZE(hexbuffer);
|
||||||
find_unique_abbrev_r(hex, sha1, len);
|
find_unique_abbrev_r(hex, sha1, len);
|
||||||
return hex;
|
return hex;
|
||||||
}
|
}
|
||||||
|
@ -187,7 +187,7 @@ void prepare_to_write_split_index(struct index_state *istate)
|
|||||||
/* Go through istate->cache[] and mark CE_MATCHED to
|
/* Go through istate->cache[] and mark CE_MATCHED to
|
||||||
* entry with positive index. We'll go through
|
* entry with positive index. We'll go through
|
||||||
* base->cache[] later to delete all entries in base
|
* base->cache[] later to delete all entries in base
|
||||||
* that are not marked eith either CE_MATCHED or
|
* that are not marked with either CE_MATCHED or
|
||||||
* CE_UPDATE_IN_BASE. If istate->cache[i] is a
|
* CE_UPDATE_IN_BASE. If istate->cache[i] is a
|
||||||
* duplicate, deduplicate it.
|
* duplicate, deduplicate it.
|
||||||
*/
|
*/
|
||||||
|
@ -4,15 +4,17 @@ test_description='blob conversion via gitattributes'
|
|||||||
|
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
TEST_ROOT="$(pwd)"
|
TEST_ROOT="$PWD"
|
||||||
|
PATH=$TEST_ROOT:$PATH
|
||||||
|
|
||||||
cat <<EOF >"$TEST_ROOT/rot13.sh"
|
write_script <<\EOF "$TEST_ROOT/rot13.sh"
|
||||||
#!$SHELL_PATH
|
|
||||||
tr \
|
tr \
|
||||||
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' \
|
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' \
|
||||||
'nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXYZABCDEFGHIJKLM'
|
'nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXYZABCDEFGHIJKLM'
|
||||||
EOF
|
EOF
|
||||||
chmod +x "$TEST_ROOT/rot13.sh"
|
|
||||||
|
write_script rot13-filter.pl "$PERL_PATH" \
|
||||||
|
<"$TEST_DIRECTORY"/t0021/rot13-filter.pl
|
||||||
|
|
||||||
generate_random_characters () {
|
generate_random_characters () {
|
||||||
LEN=$1
|
LEN=$1
|
||||||
@ -22,13 +24,12 @@ generate_random_characters () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
file_size () {
|
file_size () {
|
||||||
cat "$1" | wc -c | sed "s/^[ ]*//"
|
perl -e 'print -s $ARGV[0]' "$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
filter_git () {
|
filter_git () {
|
||||||
rm -f rot13-filter.log &&
|
rm -f rot13-filter.log &&
|
||||||
git "$@" 2>git-stderr.log &&
|
git "$@"
|
||||||
rm -f git-stderr.log
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Compare two files and ensure that `clean` and `smudge` respectively are
|
# Compare two files and ensure that `clean` and `smudge` respectively are
|
||||||
@ -40,10 +41,9 @@ test_cmp_count () {
|
|||||||
actual=$2
|
actual=$2
|
||||||
for FILE in "$expect" "$actual"
|
for FILE in "$expect" "$actual"
|
||||||
do
|
do
|
||||||
sort "$FILE" | uniq -c | sed "s/^[ ]*//" |
|
sort "$FILE" | uniq -c |
|
||||||
sed "s/^\([0-9]\) IN: clean/x IN: clean/" |
|
sed -e "s/^ *[0-9][0-9]*[ ]*IN: /x IN: /" >"$FILE.tmp" &&
|
||||||
sed "s/^\([0-9]\) IN: smudge/x IN: smudge/" >"$FILE.tmp" &&
|
mv "$FILE.tmp" "$FILE" || return
|
||||||
mv "$FILE.tmp" "$FILE"
|
|
||||||
done &&
|
done &&
|
||||||
test_cmp "$expect" "$actual"
|
test_cmp "$expect" "$actual"
|
||||||
}
|
}
|
||||||
@ -66,7 +66,7 @@ test_cmp_exclude_clean () {
|
|||||||
# is equal to the committed content.
|
# is equal to the committed content.
|
||||||
test_cmp_committed_rot13 () {
|
test_cmp_committed_rot13 () {
|
||||||
test_cmp "$1" "$2" &&
|
test_cmp "$1" "$2" &&
|
||||||
"$TEST_ROOT/rot13.sh" <"$1" >expected &&
|
rot13.sh <"$1" >expected &&
|
||||||
git cat-file blob :"$2" >actual &&
|
git cat-file blob :"$2" >actual &&
|
||||||
test_cmp expected actual
|
test_cmp expected actual
|
||||||
}
|
}
|
||||||
@ -342,7 +342,7 @@ test_expect_success 'diff does not reuse worktree files that need cleaning' '
|
|||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success PERL 'required process filter should filter data' '
|
test_expect_success PERL 'required process filter should filter data' '
|
||||||
test_config_global filter.protocol.process "$TEST_DIRECTORY/t0021/rot13-filter.pl clean smudge" &&
|
test_config_global filter.protocol.process "rot13-filter.pl clean smudge" &&
|
||||||
test_config_global filter.protocol.required true &&
|
test_config_global filter.protocol.required true &&
|
||||||
rm -rf repo &&
|
rm -rf repo &&
|
||||||
mkdir repo &&
|
mkdir repo &&
|
||||||
@ -435,7 +435,7 @@ test_expect_success PERL 'required process filter should filter data' '
|
|||||||
|
|
||||||
test_expect_success PERL 'required process filter takes precedence' '
|
test_expect_success PERL 'required process filter takes precedence' '
|
||||||
test_config_global filter.protocol.clean false &&
|
test_config_global filter.protocol.clean false &&
|
||||||
test_config_global filter.protocol.process "$TEST_DIRECTORY/t0021/rot13-filter.pl clean" &&
|
test_config_global filter.protocol.process "rot13-filter.pl clean" &&
|
||||||
test_config_global filter.protocol.required true &&
|
test_config_global filter.protocol.required true &&
|
||||||
rm -rf repo &&
|
rm -rf repo &&
|
||||||
mkdir repo &&
|
mkdir repo &&
|
||||||
@ -460,7 +460,7 @@ test_expect_success PERL 'required process filter takes precedence' '
|
|||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success PERL 'required process filter should be used only for "clean" operation only' '
|
test_expect_success PERL 'required process filter should be used only for "clean" operation only' '
|
||||||
test_config_global filter.protocol.process "$TEST_DIRECTORY/t0021/rot13-filter.pl clean" &&
|
test_config_global filter.protocol.process "rot13-filter.pl clean" &&
|
||||||
rm -rf repo &&
|
rm -rf repo &&
|
||||||
mkdir repo &&
|
mkdir repo &&
|
||||||
(
|
(
|
||||||
@ -495,7 +495,7 @@ test_expect_success PERL 'required process filter should be used only for "clean
|
|||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success PERL 'required process filter should process multiple packets' '
|
test_expect_success PERL 'required process filter should process multiple packets' '
|
||||||
test_config_global filter.protocol.process "$TEST_DIRECTORY/t0021/rot13-filter.pl clean smudge" &&
|
test_config_global filter.protocol.process "rot13-filter.pl clean smudge" &&
|
||||||
test_config_global filter.protocol.required true &&
|
test_config_global filter.protocol.required true &&
|
||||||
|
|
||||||
rm -rf repo &&
|
rm -rf repo &&
|
||||||
@ -515,7 +515,7 @@ test_expect_success PERL 'required process filter should process multiple packet
|
|||||||
for FILE in "$TEST_ROOT"/*.file
|
for FILE in "$TEST_ROOT"/*.file
|
||||||
do
|
do
|
||||||
cp "$FILE" . &&
|
cp "$FILE" . &&
|
||||||
"$TEST_ROOT/rot13.sh" <"$FILE" >"$FILE.rot13"
|
rot13.sh <"$FILE" >"$FILE.rot13"
|
||||||
done &&
|
done &&
|
||||||
|
|
||||||
echo "*.file filter=protocol" >.gitattributes &&
|
echo "*.file filter=protocol" >.gitattributes &&
|
||||||
@ -555,7 +555,7 @@ test_expect_success PERL 'required process filter should process multiple packet
|
|||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success PERL 'required process filter with clean error should fail' '
|
test_expect_success PERL 'required process filter with clean error should fail' '
|
||||||
test_config_global filter.protocol.process "$TEST_DIRECTORY/t0021/rot13-filter.pl clean smudge" &&
|
test_config_global filter.protocol.process "rot13-filter.pl clean smudge" &&
|
||||||
test_config_global filter.protocol.required true &&
|
test_config_global filter.protocol.required true &&
|
||||||
rm -rf repo &&
|
rm -rf repo &&
|
||||||
mkdir repo &&
|
mkdir repo &&
|
||||||
@ -574,7 +574,7 @@ test_expect_success PERL 'required process filter with clean error should fail'
|
|||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success PERL 'process filter should restart after unexpected write failure' '
|
test_expect_success PERL 'process filter should restart after unexpected write failure' '
|
||||||
test_config_global filter.protocol.process "$TEST_DIRECTORY/t0021/rot13-filter.pl clean smudge" &&
|
test_config_global filter.protocol.process "rot13-filter.pl clean smudge" &&
|
||||||
rm -rf repo &&
|
rm -rf repo &&
|
||||||
mkdir repo &&
|
mkdir repo &&
|
||||||
(
|
(
|
||||||
@ -618,14 +618,14 @@ test_expect_success PERL 'process filter should restart after unexpected write f
|
|||||||
|
|
||||||
# Smudge failed
|
# Smudge failed
|
||||||
! test_cmp smudge-write-fail.o smudge-write-fail.r &&
|
! test_cmp smudge-write-fail.o smudge-write-fail.r &&
|
||||||
"$TEST_ROOT/rot13.sh" <smudge-write-fail.o >expected &&
|
rot13.sh <smudge-write-fail.o >expected &&
|
||||||
git cat-file blob :smudge-write-fail.r >actual &&
|
git cat-file blob :smudge-write-fail.r >actual &&
|
||||||
test_cmp expected actual
|
test_cmp expected actual
|
||||||
)
|
)
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success PERL 'process filter should not be restarted if it signals an error' '
|
test_expect_success PERL 'process filter should not be restarted if it signals an error' '
|
||||||
test_config_global filter.protocol.process "$TEST_DIRECTORY/t0021/rot13-filter.pl clean smudge" &&
|
test_config_global filter.protocol.process "rot13-filter.pl clean smudge" &&
|
||||||
rm -rf repo &&
|
rm -rf repo &&
|
||||||
mkdir repo &&
|
mkdir repo &&
|
||||||
(
|
(
|
||||||
@ -664,7 +664,7 @@ test_expect_success PERL 'process filter should not be restarted if it signals a
|
|||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success PERL 'process filter abort stops processing of all further files' '
|
test_expect_success PERL 'process filter abort stops processing of all further files' '
|
||||||
test_config_global filter.protocol.process "$TEST_DIRECTORY/t0021/rot13-filter.pl clean smudge" &&
|
test_config_global filter.protocol.process "rot13-filter.pl clean smudge" &&
|
||||||
rm -rf repo &&
|
rm -rf repo &&
|
||||||
mkdir repo &&
|
mkdir repo &&
|
||||||
(
|
(
|
||||||
|
2
t/t0021/rot13-filter.pl
Executable file → Normal file
2
t/t0021/rot13-filter.pl
Executable file → Normal file
@ -1,4 +1,3 @@
|
|||||||
#!/usr/bin/perl
|
|
||||||
#
|
#
|
||||||
# Example implementation for the Git filter protocol version 2
|
# Example implementation for the Git filter protocol version 2
|
||||||
# See Documentation/gitattributes.txt, section "Filter Protocol"
|
# See Documentation/gitattributes.txt, section "Filter Protocol"
|
||||||
@ -22,6 +21,7 @@
|
|||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
use IO::File;
|
||||||
|
|
||||||
my $MAX_PACKET_CONTENT_SIZE = 65516;
|
my $MAX_PACKET_CONTENT_SIZE = 65516;
|
||||||
my @capabilities = @ARGV;
|
my @capabilities = @ARGV;
|
||||||
|
71
t/t5615-alternate-env.sh
Executable file
71
t/t5615-alternate-env.sh
Executable file
@ -0,0 +1,71 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
test_description='handling of alternates in environment variables'
|
||||||
|
. ./test-lib.sh
|
||||||
|
|
||||||
|
check_obj () {
|
||||||
|
alt=$1; shift
|
||||||
|
while read obj expect
|
||||||
|
do
|
||||||
|
echo "$obj" >&3 &&
|
||||||
|
echo "$obj $expect" >&4
|
||||||
|
done 3>input 4>expect &&
|
||||||
|
GIT_ALTERNATE_OBJECT_DIRECTORIES=$alt \
|
||||||
|
git "$@" cat-file --batch-check='%(objectname) %(objecttype)' \
|
||||||
|
<input >actual &&
|
||||||
|
test_cmp expect actual
|
||||||
|
}
|
||||||
|
|
||||||
|
test_expect_success 'create alternate repositories' '
|
||||||
|
git init --bare one.git &&
|
||||||
|
one=$(echo one | git -C one.git hash-object -w --stdin) &&
|
||||||
|
git init --bare two.git &&
|
||||||
|
two=$(echo two | git -C two.git hash-object -w --stdin)
|
||||||
|
'
|
||||||
|
|
||||||
|
test_expect_success 'objects inaccessible without alternates' '
|
||||||
|
check_obj "" <<-EOF
|
||||||
|
$one missing
|
||||||
|
$two missing
|
||||||
|
EOF
|
||||||
|
'
|
||||||
|
|
||||||
|
test_expect_success 'access alternate via absolute path' '
|
||||||
|
check_obj "$PWD/one.git/objects" <<-EOF
|
||||||
|
$one blob
|
||||||
|
$two missing
|
||||||
|
EOF
|
||||||
|
'
|
||||||
|
|
||||||
|
test_expect_success 'access multiple alternates' '
|
||||||
|
check_obj "$PWD/one.git/objects:$PWD/two.git/objects" <<-EOF
|
||||||
|
$one blob
|
||||||
|
$two blob
|
||||||
|
EOF
|
||||||
|
'
|
||||||
|
|
||||||
|
# bare paths are relative from $GIT_DIR
|
||||||
|
test_expect_success 'access alternate via relative path (bare)' '
|
||||||
|
git init --bare bare.git &&
|
||||||
|
check_obj "../one.git/objects" -C bare.git <<-EOF
|
||||||
|
$one blob
|
||||||
|
EOF
|
||||||
|
'
|
||||||
|
|
||||||
|
# non-bare paths are relative to top of worktree
|
||||||
|
test_expect_success 'access alternate via relative path (worktree)' '
|
||||||
|
git init worktree &&
|
||||||
|
check_obj "../one.git/objects" -C worktree <<-EOF
|
||||||
|
$one blob
|
||||||
|
EOF
|
||||||
|
'
|
||||||
|
|
||||||
|
# path is computed after moving to top-level of worktree
|
||||||
|
test_expect_success 'access alternate via relative path (subdir)' '
|
||||||
|
mkdir subdir &&
|
||||||
|
check_obj "one.git/objects" -C subdir <<-EOF
|
||||||
|
$one blob
|
||||||
|
EOF
|
||||||
|
'
|
||||||
|
|
||||||
|
test_done
|
@ -183,16 +183,24 @@ test_expect_success 'up-to-date merge without common ancestor' '
|
|||||||
|
|
||||||
test_expect_success 'custom merge does not lock index' '
|
test_expect_success 'custom merge does not lock index' '
|
||||||
git reset --hard anchor &&
|
git reset --hard anchor &&
|
||||||
write_script sleep-one-second.sh <<-\EOF &&
|
write_script sleep-an-hour.sh <<-\EOF &&
|
||||||
sleep 1 &
|
sleep 3600 &
|
||||||
echo $! >sleep.pid
|
echo $! >sleep.pid
|
||||||
EOF
|
EOF
|
||||||
test_when_finished "kill \$(cat sleep.pid)" &&
|
|
||||||
|
|
||||||
test_write_lines >.gitattributes \
|
test_write_lines >.gitattributes \
|
||||||
"* merge=ours" "text merge=sleep-one-second" &&
|
"* merge=ours" "text merge=sleep-an-hour" &&
|
||||||
test_config merge.ours.driver true &&
|
test_config merge.ours.driver true &&
|
||||||
test_config merge.sleep-one-second.driver ./sleep-one-second.sh &&
|
test_config merge.sleep-an-hour.driver ./sleep-an-hour.sh &&
|
||||||
|
|
||||||
|
# We are testing that the custom merge driver does not block
|
||||||
|
# index.lock on Windows due to an inherited file handle.
|
||||||
|
# To ensure that the backgrounded process ran sufficiently
|
||||||
|
# long (and has been started in the first place), we do not
|
||||||
|
# ignore the result of the kill command.
|
||||||
|
# By packaging the command in test_when_finished, we get both
|
||||||
|
# the correctness check and the clean-up.
|
||||||
|
test_when_finished "kill \$(cat sleep.pid)" &&
|
||||||
git merge master
|
git merge master
|
||||||
'
|
'
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user