summaryrefslogtreecommitdiff
path: root/t
AgeCommit message (Collapse)Author
2006-08-15t4116 apply --reverse testJunio C Hamano
The binary patch test needs to be made more careful not to have the postimage blob in the repository in which the patch is applied Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-13Merge branch 'jc/grep'Junio C Hamano
2006-08-13t/t4013: fix futzing with the version string.Junio C Hamano
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-12git-grep: show pathnames relative to the current directoryJunio C Hamano
By default, the command shows pathnames relative to the current directory. Use --full-name (the same flag to do so in ls-files) if you want to see the full pathname relative to the project root. This makes it very pleasant to run in Emacs compilation (or "grep-find") buffer. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-10git-apply: applying a patch to make a symlink shorter.Junio C Hamano
The internal representation of the result is counted string (i.e. char *buf and ulong size), which is fine for writing out to regular file, but throwing the buf at symlink(2) was a no-no. Reported by Willy Tarreau. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-06Fix "grep -w"Junio C Hamano
We used to find the first match of the pattern and then if the match is not for the entire word, declared that the whole line does not match. But that is wrong. The command "git grep -w -e mmap" should find that a line "foo_mmap bar mmap baz" matches, by tring the second instance of pattern "mmap" on the same line. Problems an earlier round of "fix" had were pointed out by Morten Welinder, which have been incorporated in the t7002 tests. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-03Add a couple of subdirectory tests.Junio C Hamano
We still have too few of them, but we have to start from somewhere. The general rule is to make tests easy to debug when run with -v (notice use of seemingly useless echo everywhere in the new tests). Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-02Remove cmd_usage() routine and re-organize the help/usage code.Ramsay Allan Jones
The cmd_usage() routine was causing warning messages due to a NULL format parameter being passed in three out of four calls. This is a problem if you want to compile with -Werror. A simple solution is to simply remove the GNU __attribute__ format pragma from the cmd_usage() declaration in the header file. The function interface was somewhat muddled anyway, so re-write the code to finesse the problem. [jc: this incidentally revealed that t9100 test assumed that the output from "git help" to be fixed in stone, but this patch lower-cases "Usage" to "usage". Update the test not to rely on "git help" output.] Signed-off-by: Ramsay Allan Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-02New tests and en-passant modifications to mktag.Ramsay Allan Jones
These changes were originally part of the next patch, but have been split out since they were peripheral to the main purpose of that patch. - update comment describing the signature format to reflect the current code. - remove trailing \n in calls to error(), since a \n is already provided by error(). - remove redundant call to get_sha1_hex(). - call sha1_to_hex(sha1) to convert to ascii, rather than attempting to print the raw sha1. The new tests provide a regression suite to support the modifications to git-mktag in this and the next patch. Signed-off-by: Ramsay Allan Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-02Fix annotate test script; notice when git-annotate fails.Ramsay Allan Jones
The t8001-annotate.sh test claimed all tests pass, when in fact the git-annotate perl script failed to run! (prior to fixing the script to work with perl 5.5). Signed-off-by: Ramsay Allan Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-30Merge branch 'js/mv'Junio C Hamano
* js/mv: builtin git-mv: support moving directories Make git-mv a builtin Extract helper bits from c-merge-recursive work
2006-07-29Display an error from update-ref if target ref name is invalid.Shawn Pearce
Alex Riesen (raa.lkml@gmail.com) recently observed that git branch would fail with no error message due to unexpected situations with regards to refs. For example, if .git/refs/heads/gu is a file but "git branch -b refs/heads/gu/fixa HEAD" was invoked by the user it would fail silently due to refs/heads/gu being a file and not a directory. This change adds a test for trying to create a ref within a directory that is actually currently a file, and adds error printing within the ref locking routine should the resolve operation fail. The error printing code probably belongs at this level of the library as other failures within the ref locking, writing and logging code are also currently at this level of the code. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-28t4103: fix binary patch application test.Junio C Hamano
The generated binary patch was _not_ binary -- earlier I made the --full-index flag to imply binary patch generation to the diff machinery, but later we made it independent from --binary (although the latter implies the former). Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-28Teach git-apply about '-R'Johannes Schindelin
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-26builtin git-mv: support moving directoriesJohannes Schindelin
This fixes the builtin mv for the test which Josef provided, and also fixes moving directories into existing directories, as noted by Jon Smirl. In case the destination exists, fail early (this cannot be overridden by -f). Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-26t7001: add test for git-mv dir1 dir2/Johannes Schindelin
If dir2 already exists, git-mv should move dir1 _into_dir2/. Noticed by Jon Smirl. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-26t4112: simplify the test and remove unneeded working tree file.Junio C Hamano
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-26Extend testing git-mv for renaming of subdirectoriesJosef Weidendorfer
Signed-off-by: Josef Weidendorfer <Josef.Weidendorfer@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-25Merge branch 'ew/apply'Junio C Hamano
* ew/apply: Fix t4114 on cygwin apply: handle type-changing patch correctly. apply: split out removal and creation into different phases. apply: check D/F conflicts more carefully. typechange tests for git apply (currently failing)
2006-07-25Trivial path optimization testAlex Riesen
Linus: get_pathspec() does turn '.' into an empty string (which is correct - git internally does _not_ ever understand the notion of "." as the current working directory), but it doesn't ever do the optimization of noticing that a pathspec that consists solely of an empty string is "equivalent" to an empty pathspec. The test is to ensure that this behaviour stays. Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-17typechange tests for git apply (currently failing)Eric Wong
I've found that git apply is incapable of handling patches involving object type changes to the same path. Of course git itself is perfectly capable of making commits that generate these changes, as it only tracks trees states. It's just that the diffs between them are less useful if they can't be applied. Some of these are rare, but I've hit one of them (file becoming a symlink) recently in real-world usage, and was inspired to find more potential breakages :) I'm not sure when I'll have time to fix these myself and I'm not very familiar with the apply code. So if someone could get some or all of these cases working, they would be my hero :) Some of these are what I would refer to as corner-cases from hell. Most (if not all) other systems fail some of these. In fact, they aren't even capable of representing most of these changes in their histories; much less being able to handle patches to that effect. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-14Adjust t4013 tests to corrected format-patch.Junio C Hamano
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-14t4013 diff format tests updateJunio C Hamano
This changes one test commit in the sequence to have more than one lines of commit log. A few output formats (--pretty=email aka format-patch and --pretty=oneline) need to behave differently on single and multi-line log, and this change will help catching breakages. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-13Merge branch 'ml/trace'Junio C Hamano
* ml/trace: test-lib: unset GIT_TRACE GIT_TRACE: fix a mixed declarations and code warning GIT_TRACE: show which built-in/external commands are executed
2006-07-13test-lib: unset GIT_TRACEJunio C Hamano
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-13Merge branch 'js/merge-base'Junio C Hamano
* js/merge-base: Additional merge-base tests (revised) merge-base: update the clean-up postprocessing
2006-07-11tests: Set EDITOR=: and VISUAL=: globallyEric Wong
This way we don't have to remember to set it for each test; and if we forget, we won't cause interactive editors to be spawned for non-interactive tests. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-11Record the type of commit operation in the reflog.Shawn Pearce
If committing a merge (.git/MERGE_HEAD exists), an initial tree (no HEAD) or using --amend to amend the prior commit then denote the subtype of commit in the reflog. This helps to distinguish amended or merge commits from normal commits. In the case of --amend the prior sha1 is probably the commit which is being thrown away in favor of the new commit. Since it is likely that the old commit doesn't have any ref pointing to it anymore it can be interesting to know why that the commit was replaced and orphaned. In the case of a merge the prior sha1 is probably the first parent of the new merge commit. Consequently having its prior sha1 in the reflog is slightly less interesting but its still informative to know the commit was the result of a merge which had to be completed by hand. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-10Fix more typos, primarily in the codePavel Roskin
The only visible change is that git-blame doesn't understand "--compability" anymore, but it does accept "--compatibility" instead, which is already documented. Signed-off-by: Pavel Roskin <proski@gnu.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-09Additional merge-base tests (revised)A Large Angry SCM
Signed-off-by: A Large Angry SCM <gitzilla@gmail.com>
2006-07-07git-svn: migrate out of contrib (follow-up)Junio C Hamano
Check for SVN::Core so test 910[45] don't fail if the user doesn't have those installed. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-07git-svn: migrate out of contribEric Wong
Allow NO_SVN_TESTS to be defined to skip git-svn tests. These tests are time-consuming due to SVN being slow, and even more so if SVN Perl libraries are not available. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-05Merge branch 'jc/fmt-merge-msg-test'Junio C Hamano
* jc/fmt-merge-msg-test: t6200: fmt-merge-msg test.
2006-07-05Merge branch 'jc/diff-test'Junio C Hamano
* jc/diff-test: t4013: add "diff" UI program tests.
2006-07-05Merge branch 'th/diff'Junio C Hamano
* th/diff: builtin-diff: turn recursive on when defaulting to --patch format. t4013: note improvements brought by the new output code. t4013: add format-patch tests. format-patch: fix diff format option implementation combine-diff.c: type sanity. t4013 test updates for new output code. Fix some more diff options changes. Fix diff-tree -s log --raw: Don't descend into subdirectories by default diff-tree: Use ---\n as a message separator Print empty line between raw, stat, summary and patch t4013: add more tests around -c and --cc whatchanged: Default to DIFF_FORMAT_RAW Don't xcalloc() struct diffstat_t Add msg_sep to diff_options DIFF_FORMAT_RAW is not default anymore Set default diff output format after parsing command line Make --raw option available for all diff commands Merge with_raw, with_stat and summary variables to output_format t4013: add tests for diff/log family output options.
2006-07-04t8001-annotate: fix a bash-ism in this testEric Wong
Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-04t6200: fmt-merge-msg test.Junio C Hamano
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-04send-email: do not barf when Term::ReadLine does not like your terminalJunio C Hamano
As long as we do not need to readline from the terminal, we should not barf when starting up the program. Without this patch, t9001 test on Cygwin occasionally died with the following error message: Unable to get Terminal Size. The TIOCGWINSZ ioctl didn't work. The COLUMNS and LINES environment variables didn't work. The resize program didn't work. at /usr/lib/perl5/vendor_perl/5.8/cygwin/Term/ReadKey.pm line 362. Compilation failed in require at /usr/lib/perl5/vendor_perl/5.8/Term/ReadLine/Perl.pm line 58. Acked-by: Ryan Anderson <ryan@michonline.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-04annotate: Support annotation of files on other revisions.Ryan Anderson
This is a bug fix, and cleans up one or two other things spotted during the course of tracking down the main bug here. Also, the test-suite is updated to reflect this case. Signed-off-by: Ryan Anderson <ryan@michonline.com> (cherry picked from 2f7554b4db3ab2c2d3866b160245c91c9236fc9a commit) Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-02t4013: add "diff" UI program tests.Junio C Hamano
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-29t4013: note improvements brought by the new output code.Junio C Hamano
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-29Merge branch 'jc/diff-test' into jc/diff-test-updatesJunio C Hamano
* jc/diff-test: t4013: add format-patch tests.
2006-06-29t4013: add format-patch tests.Junio C Hamano
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-29Merge branch 'js/patch'Junio C Hamano
* js/patch: diff.c: fix get_patch_id() t4014: fix test commit labels. format-patch: use clear_commit_marks() instead of some ad-hockery t4014: fix for whitespace from "wc -l" t4014: add format-patch --ignore-if-in-upstream test format-patch: introduce "--ignore-if-in-upstream" add diff_flush_patch_id() to calculate the patch id
2006-06-29t4014: fix test commit labels.Junio C Hamano
The commit tag and commit comments used in the test claimed that the #1 commit was merged upstream where the test actually let the upstream merge #2 commit. Fix them. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-29checkout -m: fix read-tree invocationv1.4.1-rc2Junio C Hamano
When we updated "read-tree -m -u" to be careful about not removing untracked working tree files, we broke "checkout -m" to switch between branches. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-28t/README: start testing porcelainishJunio C Hamano
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-27t4013 test updates for new output code.Junio C Hamano
These are updates to the test vector that shows the "incompatibility" of the new output code. The changes are actually the good ones, so instead of keeping the older output we adjust the test to the new code. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-27t4014: fix for whitespace from "wc -l"Johannes Schindelin
Some "wc" insist on putting a TAB in front of the number. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-27t4013: add more tests around -c and --ccJunio C Hamano
Signed-off-by: Junio C Hamano <junkio@cox.net>