summaryrefslogtreecommitdiff
path: root/t
AgeCommit message (Collapse)Author
2006-02-22git-add: Add support for --, documentation, and test.Carl Worth
This adds support to git-add to allow the common -- to separate command-line options and file names. It adds documentation and a new git-add test case as well. [jc: this should apply to 1.2.X maintenance series, so I reworked git-ls-files --error-unmatch test. ] Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-18Make git-reset delete empty directoriesShawn Pearce
When git-reset --hard is used and a subdirectory becomes empty (as it contains no tracked files in the target tree) the empty subdirectory should be removed. This matches the behavior of git-checkout-index and git-read-tree -m which would not have created the subdirectory or would have deleted it when updating the working directory. Subdirectories which are not empty will be left behind. This may happen if the subdirectory still contains object files from the user's build process (for example). [jc: simplified the logic a bit, while keeping the test script.]
2006-02-18Abstract test_create_repo out for use in tests.Carl Worth
Signed-off-by: Carl Worth <cworth@cworth.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-12avoid echo -e, there are systems where it does not workAlex Riesen
FreeBSD 4.11 being one example: the built-in echo doesn't have -e, and the installed /bin/echo does not do "-e" as well. "printf" works, laking just "\e" and "\xAB'. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-12fix "test: 2: unexpected operator" on bsdAlex Riesen
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-12t5500: adjust to change in pack-object reporting behaviour.Junio C Hamano
Now pack-object is not as chatty when its stderr is not connected to a terminal, so the test needs to be adjusted for that. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-11Define GIT_(AUTHOR|COMMITTER)_(NAME|EMAIL) to known values.Junio C Hamano
Without these, running tests with an account with empty gecos field would fail. We might want to loosen error from "git-var -l" (but not "git-var GIT_AUTHOR_NAME") later, but that is more or less an independent issue. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-09t6000: fix a careless test library add-on.Junio C Hamano
It tried to "restore" GIT_AUTHOR_EMAIL environment variable but the variable started out as unset, so ended up setting it to an empty string. This is now caught as an error. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-07git-commit: revamp the git-commit semantics.Junio C Hamano
- "git commit" without _any_ parameter keeps the traditional behaviour. It commits the current index. We commit the whole index even when this form is run from a subdirectory. - "git commit --include paths..." (or "git commit -i paths...") is equivalent to: git update-index --remove paths... git commit - "git commit paths..." acquires a new semantics. This is an incompatible change that needs user training, which I am still a bit reluctant to swallow, but enough people seem to have complained that it is confusing to them. It 1. refuses to run if $GIT_DIR/MERGE_HEAD exists, and reminds trained git users that the traditional semantics now needs -i flag. 2. refuses to run if named paths... are different in HEAD and the index (ditto about reminding). Added paths are OK. 3. reads HEAD commit into a temporary index file. 4. updates named paths... from the working tree in this temporary index. 5. does the same updates of the paths... from the working tree to the real index. 6. makes a commit using the temporary index that has the current HEAD as the parent, and updates the HEAD with this new commit. - "git commit --all" can run from a subdirectory, but it updates the index with all the modified files and does a whole tree commit. - In all cases, when the command decides not to create a new commit, the index is left as it was before the command is run. This means that the two "git diff" in the following sequence: $ git diff $ git commit -a $ git diff would show the same diff if you abort the commit process by making the commit log message empty. This commit also introduces much requested --author option. $ git commit --author 'A U Thor <author@example.com>' Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-25tests: adjust breakage by stricter rev-parseJunio C Hamano
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-22t4011: "sleep 1" is not enough on FATJunio C Hamano
This test depended on "sleep 1" to be enough to dirty the index entry for a symlink. Alex noticed that on his Cygwin installation "sleep 1" was sometimes not enough, and after further discussion with Christopher Faylor, it was brought up that on FAT filesystem timestamp granularity is 2 seconds so sleeping 1 second is not enough. For now this patch takes an easy workaround of sleeping for 3 seconds. Very strictly speaking, POSIX requires lstat to fill only S_IFMT part of st_mode and st_size for symlinks, and depending on timestamp might be considered a bug, but we depend on that anyway, so it is better to test that. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-15show-branch: make the current branch and merge commits stand out.Junio C Hamano
This changes the character used to mark the commits that is on the branch from '+' to '*' for the current branch, to make it stand out. Also we show '-' for merge commits. When you have a handful branches with relatively long diversion, it is easier to see which one is the current branch this way. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-14GIT 1.1.2v1.1.2Junio C Hamano
2006-01-11name-rev: do not omit leading components of ref name.Junio C Hamano
In a repository with mainto/1.0 (to keep maintaining the 1.0.X series) and fixo/1.0 (to keep fixes that apply to both 1.0.X series and upwards) branches, "git-name-rev mainto/1.0" answered just "1.0" making things ambiguous. Show refnames unambiguously like show-branch does. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-08GIT 1.1.0v1.1.0Junio C Hamano
2006-01-08Add a test for rebase when a change was picked upstreamYann Dirson
This test exercises the standard feature that makes rebase useful. Signed-off-by: Yann Dirson <ydirson@altern.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-08Add a minimal test for git-cherryYann Dirson
This test checks that git-cherry finds the expected number of patches in two simple cases, and then tests the new limit arguments. [jc: collapsed two patches into one and added sleep to make sure the two commits would get different timestamps] Signed-off-by: Yann Dirson <ydirson@altern.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-08ls-files --others --directory: testJunio C Hamano
Add a test to run with --directory option. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-08Fix typo in debug stanza of t2001Yann Dirson
Signed-off-by: Yann Dirson <ydirson@altern.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-06Merge fixes up to GIT 1.0.7Junio C Hamano
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-06t3300: skip when filesystem does not like TAB in filenames.Junio C Hamano
Instead of checking Cygwin explicitly, see if the filesystem lets us create funny filenames. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-06trivial: check, if t/trash directory was successfully createdAlex Riesen
and was successfully entered. Otherwise git-init-db will create it directly in the working directory (t/) which can be dangerous. Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-06trivial: use git-repo-config to detect how to run tests in the test repositoryAlex Riesen
Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-06trivial: use git-repo-config to detect if the test can be run on the repositoryAlex Riesen
Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-28Fix skipping merge-order test with NO_OPENSSL=1.Gerrit Pape
Move git-rev-list --merge-order usage check for 'OpenSSL not linked' after test 1; we cannot trigger this unless we try to actually use --merge-order by giving some ref, and we do not have any ref until we run the first test to create commits. Signed-off-by: Gerrit Pape <pape@smarden.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-28Merge fixes up to GIT 1.0.6Junio C Hamano
2005-12-27Fix bogus tests on rev-list output.Junio C Hamano
These tests seem to mean checking the output with expected result, but was not doing its handrolled test helper function. Also fix the guard to workaround wc output that have whitespace padding, which was broken but not exposed because the test was not testing it ;-). Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-27Guard a test against wc that pads its output with whitespaceJunio C Hamano
Spotted by Johannes. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-27Merge fixes up to GIT 1.0.5Junio C Hamano
2005-12-27Handle symlinks graciouslyJohannes Schindelin
This patch converts a stat() to an lstat() call, thereby fixing the case when the date of a symlink was not the same as the one recorded in the index. The included test case demonstrates this. This is for the case that the symlink points to a non-existing file. If the file exists, worse things than just an error message happen. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-27t5300: avoid false failures.Junio C Hamano
Johannes found that the test has 1/256 chance of falsely producing an uncorrupted idx file, causing the check to detect corruption fail. Now we have 1/2^160 chance of false failure ;-). Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-23check_packed_git_idx(): check integrity of the idx file itself.Junio C Hamano
Although pack-check.c had routine to verify the checksum for the pack index file itself, the core did not check it before using it. This is stolen from the patch to tighten packname requirements. Signed-off-by: Junio C Hamano <junkio@cox.net> (cherry picked from 797bd6f490c91c07986382b9f268e0df712cb246 commit)
2005-12-23check_packed_git_idx(): check integrity of the idx file itself.Junio C Hamano
Although pack-check.c had routine to verify the checksum for the pack index file itself, the core did not check it before using it. This is stolen from the patch to tighten packname requirements. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-22merge-recursive: conflicting rename case.Junio C Hamano
This changes the way the case two branches rename the same path to different paths is handled. Earlier, the code removed the original path and added both destinations to the index at stage0. This commit changes it to leave the original path at stage1, and two destination paths at stage2 and stage3, respectively. [jc: I am not really sure if this makes much difference in the real life merge situations. What should happen when our branch renames A to B and M to N, while their branch renames A to M? That is, M remains in our tree as is.] Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-20Racy GIT (part #2)Junio C Hamano
The previous round caught the most trivial case well, but broke down once index file is updated again. Smudge problematic entries (they should be very few if any under normal interactive workflow) before writing a new index file out. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-20Racy GITJunio C Hamano
This fixes the longstanding "Racy GIT" problem, which was pretty much there from the beginning of time, but was first demonstrated by Pasky in this message on October 24, 2005: http://marc.theaimsgroup.com/?l=git&m=113014629716878 If you run the following sequence of commands: echo frotz >infocom git update-index --add infocom echo xyzzy >infocom so that the second update to file "infocom" does not change st_mtime, what is recorded as the stat information for the cache entry "infocom" exactly matches what is on the filesystem (owner, group, inum, mtime, ctime, mode, length). After this sequence, we incorrectly think "infocom" file still has string "frotz" in it, and get really confused. E.g. git-diff-files would say there is no change, git-update-index --refresh would not even look at the filesystem to correct the situation. Some ways of working around this issue were already suggested by Linus in the same thread on the same day, including waiting until the next second before returning from update-index if a cache entry written out has the current timestamp, but that means we can make at most one commit per second, and given that the e-mail patch workflow used by Linus needs to process at least 5 commits per second, it is not an acceptable solution. Linus notes that git-apply is primarily used to update the index while processing e-mailed patches, which is true, and git-apply's up-to-date check is fooled by the same problem but luckily in the other direction, so it is not really a big issue, but still it is disturbing. The function ce_match_stat() is called to bypass the comparison against filesystem data when the stat data recorded in the cache entry matches what stat() returns from the filesystem. This patch tackles the problem by changing it to actually go to the filesystem data for cache entries that have the same mtime as the index file itself. This works as long as the index file and working tree files are on the filesystems that share the same monotonic clock. Files on network mounted filesystems sometimes get skewed timestamps compared to "date" output, but as long as working tree files' timestamps are skewed the same way as the index file's, this approach still works. The only problematic files are the ones that have the same timestamp as the index file's, because two file updates that sandwitch the index file update must happen within the same second to trigger the problem. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-20tests: make scripts executableJunio C Hamano
just for consistency. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-18Revert "get_sha1_basic(): corner case ambiguity fix"Junio C Hamano
This reverts 6677c4665af2d73f670bec382bc82d0f2e9513fb commit. The misguided disambiguation has been reverted, so there is no point testing that misfeature.
2005-12-15get_sha1_basic(): corner case ambiguity fixJunio C Hamano
When .git/refs/heads/frotz and .git/refs/tags/frotz existed, and the object name stored in .git/refs/heads/frotz were corrupt, we ended up picking tags/frotz without complaining. Worse yet, if the corrupt .git/refs/heads/frotz was more than 40 bytes and began with hexadecimal characters, it silently overwritten the initial part of the returned result. This commit adds a couple of tests to demonstrate these cases, with a fix. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-15git rebase loses author name/email if given bad email addressAmos Waterland
If GIT_AUTHOR_EMAIL is of a certain form, `git rebase master' will blow away the author name and email when fast-forward merging commits. I have not tracked it down, but here is a testcase that demonstrates the behavior. Signed-off-by: Amos Waterland <apw@us.ibm.com> Acked-by: Michal Ostrowski <mostrows@watson.ibm.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-14t3200: branch --help does not die anymore.Junio C Hamano
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-14Make git-send-pack exit with error when some refs couldn't be pushed outPetr Baudis
In case some refs couldn't be pushed out due to an error (mostly the not-a-proper-subset error), make git-send-pack exit with non-zero status after the push is over (that is, it still tries to push out the rest of the refs). [jc: I adjusted a test for this change.] Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-13Revert "Add deltifier test."Junio C Hamano
This reverts e726715a52e25d8035c89d4ea09398599610737e commit, because reverting diff-delta emptiness change would break this test.
2005-12-12Add deltifier test.Junio C Hamano
This test kicks in only if you built test-delta executable, and makes sure that the basic delta routine is working properly even on empty files. This commit is to make sure we have a test to catch the breakage. The delitifier code is still broken, which will be fixed with the next commit. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-11t/t6022: a new test for renaming merge.Junio C Hamano
This adds a couple of tests to cover the following renaming merge cases: - one side renames and the other side does not, with and without content conflicts. - both side rename to the same path, with and without content conflicts. The test setup also prepares a case in which both side rename to different destination, but currently the code collapses these destination paths and removes the original path, which may be wrong. The outcome of this case is not checked by the tests in this round. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-11t0000: catch trivial pilot errors.Junio C Hamano
People seem to be getting test failure from t6021 not becuase git is faulty but because they forgot to install "merge". Check this and other trivial pilot errors in the first test. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-11t3300: funny name testJunio C Hamano
Add double quote character to the test pattern. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-10Use GIT_EXEC_PATH explicitly for initial git-init-db in tests.Junio C Hamano
This is just a belts-and-suspenders check, but makes sure we have both "git" and "git-init-db" built, executable, and checking. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-09use "git init-db" in testsAlex Riesen
This is to catch an error where tests are run without first building what are being tested. Relying on prefixing $PATH with the build directory and expect that the PATH mechanism would find what we just built would silently run an already installed binaries from the PATH. Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-08Make sure we use compat/subprocess.py with Python 2.3 while running tests.Junio C Hamano
Otherwise the test will not succeed without installing. Signed-off-by: Junio C Hamano <junkio@cox.net>