summaryrefslogtreecommitdiff
path: root/t
AgeCommit message (Collapse)Author
2010-11-17git notes merge: Initial implementation handling trivial merges onlyJohan Herland
This initial implementation of 'git notes merge' only handles the trivial merge cases (i.e. where the merge is either a no-op, or a fast-forward). The patch includes testcases for these trivial merge cases. Future patches will extend the functionality of 'git notes merge'. This patch has been improved by the following contributions: - Stephen Boyd: Simplify argc logic - Stephen Boyd: Use test_commit - Ævar Arnfjörð Bjarmason: Don't use C99 comments. - Jonathan Nieder: Add constants for common verbosity values - Jonathan Nieder: Use trace_printf(...) instead of OUTPUT(o, 5, ...) - Jonathan Nieder: Remove extraneous show() function - Jonathan Nieder: Clarify handling of empty/missing notes ref in notes_merge() - Junio C Hamano: fixup minor style issues Thanks-to: Stephen Boyd <bebarino@gmail.com> Thanks-to: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Thanks-to: Jonathan Nieder <jrnieder@gmail.com> Thanks-to: Junio C Hamano <gitster@pobox.com> Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-11-17notes.c: Use two newlines (instead of one) when concatenating notesJohan Herland
When using combine_notes_concatenate() to concatenate notes, it currently ensures exactly one newline character between the given notes. However, when using builtin/notes.c:create_note() to concatenate notes (e.g. by 'git notes append'), it adds a newline character to the trailing newline of the preceding notes object, thus resulting in _two_ newlines (aka. a blank line) separating contents of the two notes. This patch brings combine_notes_concatenate() into consistency with builtin/notes.c:create_note(), by ensuring exactly _two_ newline characters between concatenated notes. The patch also changes a few notes-related selftests accordingly. Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-11-17(trivial) t3303: Indent with tabs instead of spaces for consistencyJohan Herland
The rest of the file uses tabs for indenting. Fix the one function that doesn't. Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-09t7003: fix subdirectory-filter testThomas Rast
The test would not fail if the filtering failed to do anything, since in test -z "$(git diff HEAD directorymoved:newsubdir)"' 'directorymoved:newsubdir' is not valid, so git-diff fails without printing anything on stdout. But then the exit status of git-diff is lost, whereas test -z "" succeeds. Use 'git diff --exit-code' instead, which does the right thing and has the added bonus of showing the differences if there are any. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-06Allow "check-ref-format --branch" from subdirectoryJonathan Nieder
check-ref-format --branch requires access to the repository to resolve refs like @{-1}. Noticed by Nguyễn Thái Ngọc Duy. Cc: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-02Merge branch 'ab/tap' into maintJunio C Hamano
* ab/tap: test-lib: Remove 3 year old no-op --no-python option test-lib: Ignore --quiet under a TAP harness
2010-08-02test-lib: Remove 3 year old no-op --no-python optionÆvar Arnfjörð Bjarmason
The --no-python option was added to test-lib.sh by Johannes Schindelin in early 2006 in abb7c7b3. It was later turned into a no-op by Junio C Hamano in 7cdbff14 the same year. Over three years is long enough before removing this old wart which was retained for backwards compatibility. Our tests have been using NO_PYTHON and "test_have_prereq PYTHON" for a long time now. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-02test-lib: Ignore --quiet under a TAP harnessÆvar Arnfjörð Bjarmason
Running the tests with --quiet under a TAP harness will always fail, since a TAP harness always needs actual test output to go along with the plan that's being emitted. Change the test-lib.sh to ignore the --quiet option under HARNESS_ACTIVE to work around this. Then users that have --quiet in their GIT_TEST_OPTS can run tests under prove(1) without everything breaking. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-28Fix git rebase --continue to work with touched filesDavid D. Kilzer
When performing a non-interactive rebase, sometimes "git rebase --continue" will fail if an unmodified file is touched in the working directory: You must edit all merge conflicts and then mark them as resolved using git add This is caused by "git diff-files" reporting a difference between the index and the filesystem: :100644 100644 d00491...... 000000...... M file The fix is to run "git update-index --refresh" before "git diff-files" as is done in git-rebase--interactive. Signed-off-by: David D. Kilzer <ddkilzer@kilzer.net> Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-27Sync with 1.7.1.2Junio C Hamano
2010-07-27Sync with 1.7.0 seriesJunio C Hamano
2010-07-27config --get --path: check for unset $HOMEJonathan Nieder
If $HOME is unset (as in some automated build situations), currently git config --path path.home "~" git config --path --get path.home segfaults. Error out with Failed to expand user dir in: '~/' instead. Reported-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-26t3700-add: fix dependence on stdout and stderr bufferingJohannes Sixt
One test case checked the stdout and stderr of 'git add' by constructing a single 'expect' file that contained both streams. But when the command runs, the order of stdout and stderr output is unpredictable because it depends on how the streams are buffered. At least on Windows, the buffering is different from what the test case expected. Hence, check the two output texts separately. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Acked-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-26git-rebase--interactive.sh: use printf instead of echo to print commit messageBrandon Casey
On systems with an echo which defaults to the XSI-conformant behavior (Solaris, or others using Ksh), echo will interpret certain backslashed characters as control sequences. This can cause a problem for interactive rebase when it is used to rebase commits whose commit "subject" (the first line) contains any of these backslashed sequences. In this case, echo will substitute the control sequence for the backslashed characters and either the rebased commit message will differ from the original, or the rebase process will fail. Neither is desirable. So work around this issue by replacing the echo statements used to print out portions of the commit message, with printf. Also, add a test to test for this breakage. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Acked-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-26Merge branch 'maint-1.6.6' into maint-1.7.0Junio C Hamano
* maint-1.6.6: request-pull.txt: Document -p option Check size of path buffer before writing into it rev-parse: fix --parse-opt --keep-dashdash --stop-at-non-option
2010-07-26Merge branch 'maint-1.6.5' into maint-1.6.6Junio C Hamano
* maint-1.6.5: request-pull.txt: Document -p option Check size of path buffer before writing into it rev-parse: fix --parse-opt --keep-dashdash --stop-at-non-option
2010-07-26Merge branch 'maint-1.6.4' into maint-1.6.5Junio C Hamano
* maint-1.6.4: Check size of path buffer before writing into it rev-parse: fix --parse-opt --keep-dashdash --stop-at-non-option
2010-07-21tests: correct "does reflog exist?" testsJunio C Hamano
These two tests weren't about how "git reflog show <branch>" exits when there is no reflog, but were about "checkout" and "branch" create or not create reflog when creating a new <branch>. Update the tests to check what we are interested in, using "git rev-parse --verify". Also lose tests based on "test -f .git/logs/refs/heads/<branch>" from nearby, to avoid exposing this particular implementation detail unnecessarily. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-21t/: work around one-shot variable assignment with test_must_failBrandon Casey
See e2007832552ccea9befed9003580c494f09e666e Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-21t/README: correct an exception when breaking a && chain in testsJonathan Nieder
The correct advice should have been taken from c289c31 (t/t7006: ignore return status of shell's unset builtin, 2010-06-02). A real-life issue we experienced was with "unset", not with "export" (exporting an unset variable may have similar portability issues, though). Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-20t/{t5541,lib-httpd}: replace problematic '!()' notation with test_must_failBrandon Casey
The '!()' notation is interpreted as a pattern-list on Ksh. The Ksh man page describe it as follows: !(pattern-list) Matches anything except one of the given patterns. Ksh performs a file glob using the pattern-list and then tries to execute the first file in the list. If a space is added between the '!' and the open parens, then Ksh will not interpret it as a pattern list, but in this case, it is preferred to use test_must_fail, so lets do so. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-20t/t3700: convert two uses of negation operator '!' to use test_must_failBrandon Casey
These two lines use the negation '!' operator to negate the result of a simple command. Since these commands do not contain any pipes or other complexities, the test_must_fail function can be used and is preferred since it will additionally detect termination due to a signal. This was noticed because the second use of '!' does not include a space between the '!' and the opening parens. Ksh interprets this as follows: !(pattern-list) Matches anything except one of the given patterns. Ksh performs a file glob using the pattern-list and then tries to execute the first file in the list. If a space is added between the '!' and the open parens, then Ksh will not interpret it as a pattern list, but in this case, it is preferred to use test_must_fail, so lets do so. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-20Merge branch 'maint'Junio C Hamano
* maint: t/README: clarify test_must_fail description Check size of path buffer before writing into it Conflicts: t/README
2010-07-20t/README: clarify test_must_fail descriptionBrandon Casey
Some have found the wording of the description to be somewhat ambiguous with respect to when it is desirable to use test_must_fail instead of "! <git-command>". Tweak the wording somewhat to hopefully clarify that it is _because_ test_must_fail can detect segmentation fault that it is desirable to use it instead of "! <git-command>". Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-19git submodule add: Require the new --force option to add ignored pathsJens Lehmann
To make the behavior of "git submodule add" more consistent with "git add" ignored submodule paths should not be silently added when they match an entry in a .gitignore file. To be able to override that default behavior in the same way as we can do that for "git add", the new option "--force" is introduced. Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Acked-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-19Merge branch 'jl/add-n-ignore-missing'Junio C Hamano
* jl/add-n-ignore-missing: git add: Add the "--ignore-missing" option for the dry run
2010-07-16Only run aggregate-results over actual countsThomas Rast
The current make target 'aggregate-results' scanned all files matching test-results/t*-*. Normally these are only the test counts (and the exit values, which are ignored), but with --tee the suite also dumps all output. Furthermore, with --verbose t1450 contains several lines starting with "broken link from ..." which matches the criteria used by aggregate-results.sh. Rename the counts output files to *.counts, and only scan those. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Acked-by: Sverre Rabbelier <srabbelier@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-15Merge branch 'jn/paginate-fix'Junio C Hamano
* jn/paginate-fix: git --paginate: paginate external commands again git --paginate: do not commit pager choice too early tests: local config file should be honored from subdirs of toplevel t7006: test pager configuration for several git commands t7006 (pager): introduce helper for parameterized tests Conflicts: t/t7006-pager.sh
2010-07-15Merge branch 'wp/merge-tree-fix'Junio C Hamano
* wp/merge-tree-fix: merge-tree: fix where two branches share no changes add basic tests for merge-tree
2010-07-15Merge branch 'js/merge-rr-fix'Junio C Hamano
* js/merge-rr-fix: MERGE_RR is in .git, not .git/rr-cache
2010-07-15Merge branch 'jn/tests'Junio C Hamano
* jn/tests: t3000 (ls-files -o): modernize style
2010-07-15Merge branch 'jn/grep-open'Junio C Hamano
* jn/grep-open: grep -O: Do not pass color sequences as filenames to pager
2010-07-15Merge branch 'jc/rebase-i-commit-msg-fix'Junio C Hamano
* jc/rebase-i-commit-msg-fix: rebase-i: do not get fooled by a log message ending with backslash rebase-i: style fix
2010-07-15Merge branch 'ab/submodule-add-f'Junio C Hamano
* ab/submodule-add-f: git submodule: add submodules with git add -f <path>
2010-07-14git --paginate: paginate external commands againJonathan Nieder
73e25e7c (git --paginate: do not commit pager choice too early, 2010-06-26) failed to take some cases into account. 1b. Builtins that do not use RUN_SETUP (like git config) do not find GIT_DIR set correctly when the pager is launched from run_builtin(). So the core.pager configuration is not honored from subdirectories of the toplevel for them. 4a. External git commands (like git request-pull) relied on the early pager launch to take care of handling the -p option. Ever since 73e25e7c, they do not honor the -p option at all. 4b. Commands invoked through ! aliases (like ls) were also relying on the early pager launch. Fix (4a) by launching the pager (if requested) before running such a “dashed external”. For simplicity, this still does not search for a .git directory before running the external command; when run from a subdirectory of the toplevel, therefore, the “[core] pager” configuration is still not honored. Fix (4b) by launching pager if requested before carrying out such an alias. Actually doing this has no effect, since the pager (if any) would have already been launched in a failed attempt to try a dashed external first. The choice-of-pager-not-honored-from- subdirectory bug still applies here, too. (1b) is not a regression. There is no need to fix it yet. Noticed by Junio. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-14MERGE_RR is in .git, not .git/rr-cacheJay Soffian
0af0ac7 (Move MERGE_RR from .git/rr-cache/ into .git/) moved the location of MERGE_RR but I found a few references to the old location. Signed-off-by: Jay Soffian <jaysoffian@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-14merge-tree: fix where two branches share no changesWill Palmer
15b4f7a (merge-tree: use ll_merge() not xdl_merge(), 2010-01-16) introduced a regression to merge-tree to cause it to segfault when merging files which existed in one branch, but not in the other or in the merge-base. This was caused by referencing entry->path at a time when entry was known to be possibly-NULL. To correct the problem, we save the path of the entry we came in with, as the path should be the same among all the stages no matter which sides are involved in the merge. Signed-off-by: Will Palmer <wmpalmer@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-14add basic tests for merge-treeWill Palmer
merge-tree had no test cases, so here we add some very basic tests for it, including some known-breakages. [jc: with obvious/trivial fixups] Signed-off-by: Will Palmer <wmpalmer@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-14Merge branch 'jc/read-tree-cache-tree-fix'Junio C Hamano
* jc/read-tree-cache-tree-fix: Fix "read-tree -m A B" priming the cache-tree
2010-07-12git add: Add the "--ignore-missing" option for the dry runJens Lehmann
Sometimes it is useful to know if a file or directory will be ignored before it is added to the work tree. An example is "git submodule add", where it would be really nice to be able to fail with an appropriate error message before the submodule is cloned and checked out. Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-12test-lib: TAP compliance for skipping tests on requestMichael J Gruber
Make the output TAP compliant for tests skipped on request (GIT_SKIP_TESTS). Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Acked-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-12test-lib: simplify GIT_SKIP_TESTS loopMichael J Gruber
04ece59 (GIT_SKIP_TESTS: allow users to omit tests that are known to break, 2006-12-28) introduced GIT_SKIP_TESTS, and since then we have had two nested loops iterating over GIT_SKIP_TESTS with the same loop variable. Reduce this to one loop. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-12Merge branch 'maint'Junio C Hamano
* maint: Documentation: Spelling fix in protocol-capabilities.txt checkout: accord documentation to what git does t0005: work around strange $? in ksh when program terminated by a signal
2010-07-12t3000 (ls-files -o): modernize styleJonathan Nieder
This script is part of the second batch of tests, from the same day the test infrastructure was added to git. Update it to use a more modern style in the spirit of v1.6.4-rc0~45^2~2 (2009-05-22). In particular: - Put setup code inside test assertions, to avoid unexpected breakages and avoid stray output without -v (as t/README recommends); and - Put the test title on the same line as the "test_expect_success", and end the line with a single-quote to begin the body of the test which is one multi-line string. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-09t0005: work around strange $? in ksh when program terminated by a signalJohannes Sixt
ksh93 is known to report $? of programs that terminated by a signal as 256 + signal number instead of 128 + signal number like other POSIX compliant shells (ksh's behavior is still POSIX compliant in this regard). Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-09Merge remote branch 'ko/master' into jc/read-tree-cache-tree-fixJunio C Hamano
* ko/master: (2325 commits) Git 1.7.2-rc2 backmerge a few more fixes to 1.7.1.X series fix git branch -m in presence of cross devices t/t0006: specify timezone as EST5 not EST to comply with POSIX add missing && to submodule-merge testcase t/README: document more test helpers test-date: fix sscanf type conversion xdiff: optimise for no whitespace difference when ignoring whitespace. gitweb: Move evaluate_gitweb_config out of run_request parse_date: fix signedness in timezone calculation t0006: test timezone parsing rerere.txt: Document forget subcommand t/README: proposed rewording... t/README: Document the do's and don'ts of tests t/README: Add a section about skipping tests t/README: Document test_expect_code t/README: Document test_external* t/README: Document the prereq functions, and 3-arg test_* t/README: Typo: paralell -> parallel t/README: The trash is in 't/trash directory.$name' ... Conflicts: builtin-read-tree.c
2010-07-09tests: Use skip_all=* to skip testsÆvar Arnfjörð Bjarmason
Change tests to skip with skip_all=* + test_done instead of using say + test_done. This is a follow-up to "tests: Skip tests in a way that makes sense under TAP" (fadb5156e4). I missed these cases when prepearing that patch, hopefully this is all of them. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-09Fix "read-tree -m A B" priming the cache-treeJunio C Hamano
In 456156d a shortcut to priming the index tree reference was introduced, but the justification for it was completely bogus. "read-tree -m A B" is to take the index (and the working tree) that is largely based on (but does not have to match exactly) A and update it to B, while carrying the local change that does not overlap the difference between A and B, so there is no reason to expect that the resulting index should match the tree B. Noticed and test provided by Heiko Voigt. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-08t9118 (git-svn): prevent early failure from taking down later testsJonathan Nieder
When test #2 fails, the cwd is project/, causing all the remaining tests in the same script to get confused and fail. So in the spirit of v1.7.1.1~53^2~10 (t5550-http-fetch: Use subshell for repository operations, 2010-04-17), use a subshell for svn working copy operations. This way, the cwd will reliably return to the top of the trash directory and later tests can still be run when a command has failed. Reported-by: A Large Angry SCM <gitzilla@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Acked-by: Eric Wong <normalperson@yhbt.net>
2010-07-08t9118: avoid PEG revision identifier in testsMichael J Gruber
@ is SVN's identifier for PEG revisions. But SVN's treatment of PEG identifiers in copy target URLs changed in r954995/r952973, i.e. between 1.6.11 and 1.6.12. They get eaten now (which is considered the right way). Therefore, avoid the @ in the tests with funky branch names. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Acked-by: Eric Wong <normalperson@yhbt.net>