summaryrefslogtreecommitdiff
path: root/t/t5515-fetch-merge-logic.sh
AgeCommit message (Collapse)Author
2020-02-17Merge branch 'bc/hash-independent-tests-part-8'Junio C Hamano
Preparation for SHA-256 migration continues. * bc/hash-independent-tests-part-8: (21 commits) t6024: update for SHA-256 t6006: make hash size independent t6000: abstract away SHA-1-specific constants t5703: make test work with SHA-256 t5607: make hash size independent t5318: update for SHA-256 t5515: make test hash independent t5321: make test hash independent t5313: make test hash independent t5309: make test hash independent t5302: make hash size independent t4060: make test work with SHA-256 t4211: add test cases for SHA-256 t4211: move SHA-1-specific test cases into a directory t4013: make test hash independent t3311: make test work with SHA-256 t3310: make test work with SHA-256 t3309: make test work with SHA-256 t3308: make test work with SHA-256 t3206: make hash size independent ...
2020-02-07t5515: make test hash independentbrian m. carlson
This test contains a large number of data files, mostly using the same object ID values for refs. Instead of producing two separate sets of test files, keep the test files using SHA-1 and translate them on the fly by replacing the SHA-1 values with the values for the current hash algorithm in use. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-01-15test: request GIT_TEST_PROTOCOL_VERSION=0 when appropriateJonathan Nieder
Since 8cbeba0632 (tests: define GIT_TEST_PROTOCOL_VERSION, 2019-02-25), it has been possible to run tests with a newer protocol version by setting the GIT_TEST_PROTOCOL_VERSION envvar to a version number. Tests that assume protocol v0 handle this by explicitly setting GIT_TEST_PROTOCOL_VERSION= or similar constructs like 'test -z "$GIT_TEST_PROTOCOL_VERSION" || return 0' to declare that they only handle the default (v0) protocol. The emphasis there is a bit off: it would be clearer to specify GIT_TEST_PROTOCOL_VERSION=0 to inform the reader that these tests are specifically testing and relying on details of protocol v0. Do so. This way, a reader does not need to know what the default protocol version is, and the tests can continue to work when the default protocol version used by Git advances past v0. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-09-05t: use LF variable defined in the test harnessJunio C Hamano
A few test scripts assign a single LF to $LF, but that is already given by test-lib.sh to everybody. Remove the unnecessary reassignment. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2019-03-07tests: fix protocol version for overspecificationsJonathan Tan
These tests are also marked with a NEEDSWORK comment. Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-12-28t/t5515-fetch-merge-logic.sh: use the $( ... ) construct for command ↵Elia Pinto
substitution The Git CodingGuidelines prefer the $(...) construct for command substitution instead of using the backquotes `...`. The backquoted form is the traditional method for command substitution, and is supported by POSIX. However, all but the simplest uses become complicated quickly. In particular, embedded command substitutions and/or the use of double quotes require careful escaping with the backslash character. The patch was generated by: for _f in $(find . -name "*.sh") do perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg' "${_f}" done and then carefully proof-read. Signed-off-by: Elia Pinto <gitter.spiros@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-19test-lib: Simplify test counting.Johannes Sixt
Since the test case counter was incremented very late, there were a few users of the counter had to do their own incrementing. Now we increment it early and simplify these users. Signed-off-by: Johannes Sixt <j6t@kdbg.org>
2008-08-17tests: use $TEST_DIRECTORY to refer to the t/ directoryJunio C Hamano
Many test scripts assumed that they will start in a 'trash' subdirectory that is a single level down from the t/ directory, and referred to their test vector files by asking for files like "../t9999/expect". This will break if we move the 'trash' subdirectory elsewhere. To solve this, we earlier introduced "$TEST_DIRECTORY" so that they can refer to t/ directory reliably. This finally makes all the tests use it to refer to the outside environment. With this patch, and a one-liner not included here (because it would contradict with what Dscho really wants to do): | diff --git a/t/test-lib.sh b/t/test-lib.sh | index 70ea7e0..60e69e4 100644 | --- a/t/test-lib.sh | +++ b/t/test-lib.sh | @@ -485,7 +485,7 @@ fi | . ../GIT-BUILD-OPTIONS | | # Test repository | -test="trash directory" | +test="trash directory/another level/yet another" | rm -fr "$test" || { | trap - exit | echo >&5 "FATAL: Cannot prepare test area" all the tests still pass, but we would want extra sets of eyeballs on this type of change to really make sure. [jc: with help from Stephan Beyer on http-push tests I do not run myself; credits for locating silly quoting errors go to Olivier Marin.] Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-19Prepare testsuite for a "git clone" that packs refsJohan Herland
t5515-fetch-merge-logic removes many, but not all, refs between each test. This is done by removing the corresponding refs/foo/* files in the .git/refs hierarchy. However, once "git clone" starts producing packed refs, these refs will no longer be in the .git/refs hierarchy, but rather listed in .git/packed-refs. This patch teaches t5515-fetch-merge-logic to remove the refs using "git update-ref -d" which properly handles packed refs. Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-24tests: do not use implicit "git diff --no-index"Junio C Hamano
As a general principle, we should not use "git diff" to validate the results of what git command that is being tested has done. We would not know if we are testing the command in question, or locating a bug in the cute hack of "git diff --no-index". Rather use test_cmp for that purpose. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-26git-fetch test: test tracking fetch results, not just FETCH_HEADJunio C Hamano
We really should have done this long time ago. Existing t5515 test was written for the specific purpose of catching regression to the contents of generated FETCH_HEAD file, but it also is a good place to make sure various fetch configurations do fetch what they intend to fetch (and nothing else). Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-19Don't attempt to merge non-existant remotes in t5515Shawn O. Pearce
This was actually reverted in 756373da by Junio. We no longer support merging the right hand side of a fetchspec in a branch's branch.$name.merge configuration setting as we interpret these names as being only those published by the remote we are going to fetch from. The older shell based implementation of git-fetch did not report an error when branch.$name.merge was referencing a branch that does not exist on the remote and we are running `git fetch` for the current branch. The new builtin-fetch does notice this failure and aborts the fetch, thus breaking the tests. Junio and I kicked it around on #git earlier today and decided that the best approach here is to error out and tell the user that their configuration is wrong, as this is likely more user friendly than silently ignoring the user's request. Since the new builtin-fetch is already issuing the error there is no code change required, we just need to remove the bad configuration from our test. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-03-11Merge branch 'js/diff-ni'Junio C Hamano
* js/diff-ni: Get rid of the dependency to GNU diff in the tests diff --no-index: support /dev/null as filename diff-ni: fix the diff with standard input diff: support reading a file from stdin via "-"
2007-03-07t/t5515-fetch-merge-logic.sh: Add two more testsSanti B,Ai(Bjar
They test the behaviour with just a URL in the command line. Signed-off-by: Santi B,Ai(Bjar <sbejar@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-05t/t5515-fetch-merge-logic.sh: Added tests for the merge login in git-fetchSanti Béjar
Signed-off-by: Santi Béjar <sbejar@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>