summaryrefslogtreecommitdiff
path: root/t
AgeCommit message (Collapse)AuthorFilesLines
2008-04-02Merge branch 'js/filter-branch'Libravatar Junio C Hamano1-2/+18
* js/filter-branch: filter-branch: Fix renaming a directory in the tree-filter filter-branch: Test renaming directories in a tree-filter
2008-04-02Merge branch 'bc/mktag'Libravatar Junio C Hamano1-5/+180
* bc/mktag: mktag.c: tweak validation of tagger field and adjust test script mktag.c: improve verification of tagger field and tests
2008-04-02Merge branch 'dd/cvsserver'Libravatar Junio C Hamano1-0/+50
* dd/cvsserver: cvsserver: Use the user part of the email in log and annotate results cvsserver: Add test for update -p cvsserver: Implement update -p (print to stdout) cvsserver: Add a few tests for 'status' command cvsserver: Do not include status output for subdirectories if -l is passed cvsserver: Only print the file part of the filename in status header cvsserver: Respond to the 'editors' and 'watchers' commands
2008-04-02t7004-tag: Skip more tests if gpg is not available.Libravatar Johannes Sixt1-7/+8
This test was already careful enough to skip signed tag tests if gpg is not available, but it must also skip all verify tests, even those that are about non-signed tags, because they also invoke gpg. Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-31mktag.c: tweak validation of tagger field and adjust test scriptLibravatar Brandon Casey1-16/+72
Update the verify_tag() function to remove an unnecessary test, and add additional check for angle brackets in the name and email field, and spaces in the email field. The timestamp and timezone sections are made more straight forward by using strspn(). Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-31filter-branch: Fix renaming a directory in the tree-filterLibravatar veillette@yahoo.ca1-1/+1
Commit d89c1df (filter-branch: don't use xargs -0, 2008-03-12) replaced a 'ls-files | xargs rm' pipeline by 'git clean'. 'git clean' however does not recurse and remove directories by default. Now, consider a tree-filter that renames a directory. 1. For the first commit everything works as expected 2. Then filter-branch checks out the files for the next commit. This leaves the new directory behind because there is no real "branch switching" involved that would notice that the directory can be removed. 3. Then filter-branch invokes 'git clean' to remove exactly those left-overs. But here it does not remove the directory. 4. The next tree-filter does not work as expected because there already exists a directory with the new name. Just add -d to 'git clean', so that empty directories are removed. Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-31filter-branch: Test renaming directories in a tree-filterLibravatar Johannes Sixt1-2/+18
This test currently fails. If b is a directory then 'mv a b' is not a plain "rename", but really a "move", so we must also test that the directory does not exist with the old name in the directory with the new name. There's also some cleanup in the corresponding "rename file" test to avoid spurious shell syntax errors and "ambigous ref" error from 'git show' (but these should show up only if the test would fail anyway). Plus we also test for the non-existence of the old file. Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
2008-03-30mktag.c: improve verification of tagger field and testsLibravatar Brandon Casey1-5/+124
Since nearly its birth, git's tags have included a "tagger" field which describes the name of tagger, email of tagger, and date and time of tagging. But, this field was only loosely tested by git-mktag. Provide some thorough testing for this field and also ensure that the tag header is separated from the tag body by an empty line to reduce the convenience of creating a flawed tag. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-30diff-files: careful when inspecting work tree itemsLibravatar Junio C Hamano1-3/+3
This fixes the same breakage in diff-files. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-30diff-index: careful when inspecting work tree itemsLibravatar Junio C Hamano1-1/+1
Earlier, if you changed a staged path into a directory in the work tree, we happily ran lstat(2) on it and found that it exists, and declared that the user changed it to a gitlink. This is wrong for two reasons: (1) It may be a directory, but it may not be a submodule, and in the latter case, the change we need to report is "the blob at the path has disappeared". We need to check with resolve_gitlink_ref() to be consistent with what "git add" and "git update-index --add" does. (2) lstat(2) may have succeeded only because a leading component of the path was turned into a symbolic link that points at something that exists in the work tree. In such a case, the path itself does not exist anymore, as far as the index is concerned. This fixes these breakages in diff-index that the previous patch has exposed. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-30Add corner case tests for diff-index and diff-filesLibravatar Junio C Hamano1-0/+140
diff-index and diff-files can get confused in corner cases when an indexed blob turns into something else in the work tree. This patch adds tests to expose such breakages. The test is classified under t2XXX series instead of t4XXX series, because the ultimate objective is to fix "add -u" (and "commit -a" that shares the same issue). Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-27cvsserver: Add test for update -pLibravatar Damien Diederen1-0/+18
Signed-off-by: Damien Diederen <dash@foobox.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-27cvsserver: Add a few tests for 'status' commandLibravatar Damien Diederen1-0/+32
Signed-off-by: Damien Diederen <dash@foobox.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-27builtin-prune: protect objects listed on the command lineLibravatar Junio C Hamano1-1/+1
Finally, this resurrects the documented behaviour to protect other objects listed on the command line from getting pruned. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-27Add tests for git-pruneLibravatar Michele Ballabio1-0/+34
It seems that git prune changed behaviour with respect to revisions added from command line, probably when it became a builtin. Currently, it prints a short usage and exits: instead, it should take those revisions into account and not prune them. So add a couple of test to point this out. We'll be fixing this by switching to parse_options(), so add tests to detect bogus command line parameters as well, to keep ourselves from introducing regressions. Signed-off-by: Michele Ballabio <barra_cuda@katamail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-27Merge branch 'maint'Libravatar Junio C Hamano1-1/+1
* maint: Update draft release notes for 1.5.4.5 Documentation: clarify use of .git{ignore,attributes} versus .git/info/* t/t3800-mktag.sh: use test_must_fail rather than '!' Conflicts: t/t3800-mktag.sh
2008-03-27Merge branch 'jc/maint-fetch-regression-1.5.4' into maintLibravatar Junio C Hamano66-7/+903
* jc/maint-fetch-regression-1.5.4: git-fetch test: test tracking fetch results, not just FETCH_HEAD Fix branches file configuration Tighten refspec processing
2008-03-27test_must_fail: 129 is a valid error code from usage()Libravatar Junio C Hamano1-1/+1
When a git command is run under test_must_fail to make sure that the argument parser catches bogus command line, it exits with 129. We need to catch it as a valid "graceful error exit". Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-26t9600-cvsimport.sh: set HOME before checking for cvsps availabilityLibravatar Frank Lichtenheld1-6/+6
This actually sounds like a bug in cvsps, which requires an existing home directory when asked for the usage through -h $ HOME=/nonexistent cvsps -h Cannot create the cvsps directory '.cvsps': No such file or directory This made t9600 think that cvsps is not available if HOME did not exist, causing the tests to be skipped $ HOME=/nonexistent sh t9600-cvsimport.sh * skipping cvsimport tests, cvsps not found * passed all 0 test(s) Now t9600 sets HOME to the current working directory before checking for the availability of the cvsps program. This issue has been discovered by Marco Rodrigues, and fixed by Frank Lichtenheld through http://bugs.debian.org/471969 Signed-off-by: Gerrit Pape <pape@smarden.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-26t/t3800-mktag.sh: use test_must_fail rather than '!'Libravatar Brandon Casey1-2/+2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-26Merge branch 'jc/maint-fetch-regression-1.5.4'Libravatar Junio C Hamano65-7/+831
* jc/maint-fetch-regression-1.5.4: git-fetch test: test tracking fetch results, not just FETCH_HEAD Fix branches file configuration Tighten refspec processing Fix the wrong output of `git-show v1.3.0~155^2~4` in documentation.
2008-03-26git-fetch test: test tracking fetch results, not just FETCH_HEADLibravatar Junio C Hamano65-7/+831
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>
2008-03-26Tighten refspec processingLibravatar Daniel Barkalow1-0/+72
This changes the pattern matching code to not store the required final / before the *, and then to require each side to be a valid ref (or empty). In particular, any refspec that looks like it should be a pattern but doesn't quite meet the requirements will be found to be invalid as a fallback non-pattern. This was cherry picked from commit ef00d15 (Tighten refspec processing, 2008-03-17), and two fix-up commits 46220ca (remote.c: Fix overtight refspec validation, 2008-03-20) and 7d19da4 (refspec: allow colon-less wildcard "refs/category/*", 2008-03-25) squashed in. Signed-off-by: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-25init: show "Reinit" message even in an (existing) empty repositoryLibravatar Johannes Schindelin1-0/+17
Earlier, git-init tested for a valid HEAD ref, but if the repository was empty, there was none. Instead, test for the existence of the file $GIT_DIR/HEAD. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-23builtin-remote: Fix missing newline at end of listing of pushed branchesLibravatar Johannes Sixt1-0/+6
Without this the output of 'git remote show' does not end with a new-line: bash> git remote show repo * remote repo URL: repo.or.cz:/srv/git/kdbg.git Tracked remote branches maint master mob Local branch pushed with 'git push' +master:masterbash> Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at> Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-22remote.c: Fix overtight refspec validationLibravatar Junio C Hamano1-0/+72
We tightened the refspec validation code in an earlier commit ef00d15 (Tighten refspec processing, 2008-03-17) per my suggestion, but the suggestion was misguided to begin with and it broke this usage: $ git push origin HEAD~12:master The syntax of push refspecs and fetch refspecs are similar in that they are both colon separated LHS and RHS (possibly prefixed with a + to force), but the similarity ends there. For example, LHS in a push refspec can be anything that evaluates to a valid object name at runtime (except when colon and RHS is missing, or it is a glob), while it must be a valid-looking refname in a fetch refspec. To validate them correctly, the caller needs to be able to say which kind of refspecs they are. It is unreasonable to keep a single interface that cannot tell which kind it is dealing with, and ask it to behave sensibly. This commit separates the parsing of the two into different functions, and clarifies the code to implement the parsing proper (i.e. splitting into two parts, making sure both sides are wildcard or neither side is). This happens to also allow pushing a commit named with the esoteric "look for that string" syntax: $ git push ../test.git ':/remote.c: Fix overtight refspec:master' Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-22Make git-svn tests behave better on OS XLibravatar Kevin Ballard1-2/+23
Give lib-git-svn.sh a few alternate paths to look for apache2. Explicitly define the LockFile so httpd will actually start under OS X Signed-off-by: Kevin Ballard <kevin@sb.org> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-22t/t7003-filter-branch.sh: use test_must_fail rather than '!'Libravatar Brandon Casey1-6/+6
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-20Don't try and percent-escape existing percent escapes in git-svn URIsLibravatar Kevin Ballard1-0/+31
git-svn project names are percent-escaped ever since f5530b8 (git-svn: support for funky branch and project names over HTTP(S), 2007-11-11). Unfortunately this breaks the scenario where the user hands git-svn an already-escaped URI. Fix the regexp to skip over what looks like existing percent escapes, and test this scenario. Signed-off-by: Kevin Ballard <kevin@sb.org> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-19remote show: do not show symbolic refsLibravatar Johannes Schindelin1-0/+10
For symbolic refs, a sane notion of being "stale" is that the ref they point to no longer exists. Since this is checked already, "remote show" does not need to show them at all. Incidentally, this fixes the issue that "HEAD" was shown as a stale ref by "remote show" in a freshly cloned repository. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-19Make revision limiting more robust against occasional bad commit datesLibravatar Linus Torvalds1-1/+1
The revision limiter uses the commit date to decide when it has seen enough commits to finalize the revision list, but that can get confused if there are incorrect dates far in the past on some commits. This makes the logic a bit more robust by - we always walk an extra SLOP commits from the source list even if we decide that the source list is probably all done (unless the source is entirely empty, of course, because then we really can't do anything at all) - we keep track of the date of the last commit we added to the destination list (this will *generally* be the oldest entry we've seen so far) - we compare that with the youngest entry (the first one) of the source list, and if the destination is older than the source, we know we want to look at the source. which causes occasional date mishaps to be handled cleanly. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-18Fix t3200 configLibravatar Daniel Barkalow1-10/+10
"git-config name = value" doesn't do anything most of the time. The test meant "git-config name value", but that leaves the configuration such that later tests will be confused, so move it to the end. Signed-off-by: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-18Fix read-tree not to discard errorsLibravatar Junio C Hamano1-1/+1
This fixes the issue identified with recently added tests to t1004 Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-18Add tests to catch problems with un-unlinkable symlinksLibravatar Junio C Hamano1-0/+35
This currently fails not because we refuse to check out, but because we detect error but incorrectly discard it in the callchain. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-18Test: catch if trash cannot be removedLibravatar Junio C Hamano1-1/+6
When your test creates an unwritable directory that test framework cannot clean out by "rm -fr trash", later tests cannot start in a fresh state they expect to. Detect this and error out early. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-18git-merge-one-file: fix longstanding stupid thinkoLibravatar Junio C Hamano1-0/+46
When a merge result creates a new file, and when our side already has a file in the path, taking the merge result may clobber the untracked file. However, the logic to detect this situation was totally the wrong way. We should complain when the file exists, not when the file does not exist. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-16Don't update unchanged merge entriesLibravatar Linus Torvalds1-0/+41
In commit 34110cd4e394e3f92c01a4709689b384c34645d8 ("Make 'unpack_trees()' have a separate source and destination index") I introduced a really stupid bug in that it would always add merged entries with the CE_UPDATE flag set. That caused us to always re-write the file, even when it was already up-to-date in the source index. Not only is that really stupid from a performance angle, but more importantly it's actively wrong: if we have dirty state in the tree when we merge, overwriting it with the result of the merge will incorrectly overwrite that dirty state. This trivially fixes the problem - simply don't set the CE_UPDATE flag when the merge result matches the old state. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-16t1000: use "test_must_fail git frotz", not "! git frotz"Libravatar Junio C Hamano1-18/+18
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-15Redo "add test_cmp function for test scripts"Libravatar Junio C Hamano2-2/+2
We had a handful test updates since we accepted 82ebb0b (add test_cmp function for test scripts). This fixes them up. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-15Merge branch 'jk/portable'Libravatar Junio C Hamano62-184/+214
* jk/portable: t6000lib: re-fix tr portability t7505: use SHELL_PATH in hook t9112: add missing #!/bin/sh header filter-branch: use $SHELL_PATH instead of 'sh' filter-branch: don't use xargs -0 add NO_EXTERNAL_GREP build option t6000lib: tr portability fix t4020: don't use grep -a add test_cmp function for test scripts remove use of "tail -n 1" and "tail -1" grep portability fix: don't use "-e" or "-q" more tr portability test script fixes t0050: perl portability fix tr portability fixes
2008-03-15Merge branch 'py/submodule'Libravatar Junio C Hamano1-0/+195
* py/submodule: git-submodule summary: fix that some "wc" flavors produce leading spaces git-submodule summary: test git-submodule summary: documentation git-submodule summary: limit summary size git-submodule summary: show commit summary git-submodule summary: code framework
2008-03-15shortlog: do not require to run from inside a git repositoryLibravatar Jonas Fonseca1-0/+5
Once upon a time shortlog could be run from a non-git directory and still do its job. Fix this regression and add a small test for it. Signed-off-by: Jonas Fonseca <fonseca@diku.dk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-15Merge branch 'maint'Libravatar Junio C Hamano2-1/+39
* maint: format-patch: generate MIME header as needed even when there is format.header
2008-03-15format-patch: generate MIME header as needed even when there is format.headerLibravatar Junio C Hamano2-1/+39
Earlier, the callchain from pretty_print_commit() down to pp_title_line() had an unwarranted assumption that the presense of "after_subject" parameter, means the caller has already output MIME headers for attachments. The parameter's primary purpose is to give extra header lines the caller wants to place after pp_title_line() generates the "Subject: " line. This assumption does not hold when the user used the format.header configuration variable to pass extra headers, and caused a message with non-ASCII character to lack proper MIME headers (e.g. 8-bit CTE header). The earlier logic also failed to suppress duplicated MIME headers when "format-patch -s --attach" is asked for and the signer's name demanded 8-bit clean transport. This patch fixes the logic by introducing a separate need_8bit_cte parameter passed down the callchain. This can have one of these values: -1 : we've already done MIME crap and we do not want to add extra header to say this is 8bit in pp_title_line(); 0 : we haven't done MIME and we have not seen anything that is 8bit yet; 1 : we haven't done MIME and we have seen something that is 8bit; pp_title_line() must add MIME header. It adds two tests by Jeff King who independently diagnosed this issue. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-14t6000lib: re-fix tr portabilityLibravatar Jeff King1-4/+7
It seems that some implementations of tr don't like a replacement string of '-----...'; they try to find the double-dash option "---...". Instead of this pipeline of tr and sed invocations, just use a single perl invocation. Signed-off-by: Jeff King <peff@peff.net>
2008-03-14Merge branch 'maint'Libravatar Junio C Hamano1-0/+49
* maint: merge-file: handle empty files gracefully merge-recursive: handle file mode changes Minor wording changes in the keyboard descriptions in git-add --interactive. git fetch: Take '-n' to mean '--no-tags' quiltimport: fix misquoting of parsed -p<num> parameter git-quiltimport: better parser to grok "enhanced" series files.
2008-03-13merge-recursive: handle file mode changesLibravatar Clemens Buchacher1-0/+49
File mode changes should be handled similarly to changes of content. That is, if the file mode changed in only one branch, keep the changed version, and if both branch changed to different mode, mark it as a conflict. Signed-off-by: Clemens Buchacher <drizzd@aon.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-13t7505: use SHELL_PATH in hookLibravatar Jeff King1-2/+3
The hook doesn't run properly under Solaris /bin/sh. Let's use the SHELL_PATH the user told us about already instead. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-13t9112: add missing #!/bin/sh headerLibravatar Jeff King1-0/+2
Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-13t6000lib: tr portability fixLibravatar Jeff King1-1/+4
Some versions of tr complain if the number of characters in both sets isn't the same. So here we must manually expand the dashes in set2. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>