summaryrefslogtreecommitdiff
path: root/t
AgeCommit message (Collapse)AuthorFilesLines
2009-08-16Merge branch 'jc/maint-clean-nested-dir-safety'Libravatar Junio C Hamano1-0/+39
* jc/maint-clean-nested-dir-safety: clean: require double -f options to nuke nested git repository and work tree
2009-08-16Merge branch 'jk/maint-merge-msg-fix'Libravatar Junio C Hamano3-3/+63
* jk/maint-merge-msg-fix: merge: indicate remote tracking branches in merge message merge: fix incorrect merge message for ambiguous tag/branch add tests for merge message headings
2009-08-12svn: allow branches outside of refs/remotesLibravatar Adam Brewster5-19/+48
It may be convenient for some users to store svn remote tracking branches outside of the refs/remotes/ heirarchy. To accomplish this feat, this patch includes the entire path to the ref in $r->{'refname'} in &read_all_remotes and tries to change references to this entry so the new value makes sense. [ew: fixed backwards compatibility, long lines] Signed-off-by: Adam Brewster <adambrewster@gmail.com> Signed-off-by: Eric Wong <normalperson@yhbt.net>
2009-08-12svn: initial "master" points to trunk if possibleLibravatar Eric Wong2-1/+31
Since "trunk" is a convention for the main development branch in the SVN world, try to make that the master branch upon initial checkout if it exists. This is probably less surprising based on user requests. t9135 was the only test which relied on the previous behavior and thus needed to be modified. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2009-08-12allow pull --rebase on branch yet to be bornLibravatar Jeff King1-0/+11
When doing a "pull --rebase", we check to make sure that the index and working tree are clean. The index-clean check compares the index against HEAD. The test erroneously reports dirtiness if we don't have a HEAD yet. In such an "unborn branch" case, by definition, a non-empty index won't be based on whatever we are pulling down from the remote, and will lose the local change. Just check if $GIT_DIR/index exists and error out. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-10Merge branch 'jc/maint-merge-recursive-fix'Libravatar Junio C Hamano1-0/+55
* jc/maint-merge-recursive-fix: merge-recursive: don't segfault while handling rename clashes
2009-08-10Merge branch 'ns/am-raw-email'Libravatar Junio C Hamano1-0/+15
* ns/am-raw-email: git-am: print fair error message when format detection fails am: allow individual e-mail files as input
2009-08-10Merge branch 'jp/symlink-dirs'Libravatar Junio C Hamano1-0/+93
* jp/symlink-dirs: t6035-merge-dir-to-symlink depends on SYMLINKS prerequisite git-checkout: be careful about untracked symlinks lstat_cache: guard against full match of length of 'name' parameter Demonstrate bugs when a directory is replaced with a symlink
2009-08-10Merge branch 'mk/grep-max-depth'Libravatar Junio C Hamano1-1/+50
* mk/grep-max-depth: grep: Add --max-depth option.
2009-08-10Merge branch 'js/run-command-updates'Libravatar Junio C Hamano1-1/+4
* js/run-command-updates: api-run-command.txt: describe error behavior of run_command functions run-command.c: squelch a "use before assignment" warning receive-pack: remove unnecessary run_status report run_command: report failure to execute the program, but optionally don't run_command: encode deadly signal number in the return value run_command: report system call errors instead of returning error codes run_command: return exit code as positive value MinGW: simplify waitpid() emulation macros
2009-08-10git-svn: ignore leading blank lines in svn:ignoreLibravatar Michael Haggerty1-1/+4
Subversion ignores all blank lines in svn:ignore properties. The old git-svn code ignored blank lines everywhere except for the first line of the svn:ignore property. This patch makes the "git svn show-ignore" and "git svn create-ignore" commands ignore leading blank lines, too. Also include leading blank lines in the test suite. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Acked-by: Eric Wong <normalperson@yhbt.net>
2009-08-10svn: Add && to t9107-git-svn-migrate.shLibravatar Adam Brewster1-3/+11
It was probably intended for the test to fail unless all of the commands succeed. [ew: fixed tests to actually work] Signed-off-by: Eric Wong <normalperson@yhbt.net>
2009-08-09merge: indicate remote tracking branches in merge messageLibravatar Jeff King2-1/+11
Previously when merging directly from a local tracking branch like: git merge origin/master The merge message said: Merge commit 'origin/master' * commit 'origin/master': ... Instead, let's be more explicit about what we are merging: Merge remote branch 'origin/master' * origin/master: ... We accomplish this by recognizing remote tracking branches in git-merge when we build the simulated FETCH_HEAD output that we feed to fmt-merge-msg. In addition to a new test in t7608, we have to tweak the expected output of t3409, which does such a merge. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-09merge: fix incorrect merge message for ambiguous tag/branchLibravatar Jeff King2-3/+3
If we have both a tag and a branch named "foo", then calling "git merge foo" will warn about the ambiguous ref, but merge the tag. When generating the commit message, though, we simply checked whether "refs/heads/foo" existed, and if it did, assumed it was a branch. This led to the statement "Merge branch 'foo'" in the commit message, which is quite wrong. Instead, we should use dwim_ref to find the actual ref used, and describe it appropriately. In addition to the test in t7608, we must also tweak the expected output of t4202, which was accidentally triggering this bug. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-09add tests for merge message headingsLibravatar Jeff King1-0/+50
When calling "git merge $X", we automatically generate a commit message containing something like "Merge branch '$X'". This test script checks that those messages say what they should, and exposes a failure when merging a refname that is ambiguous between a tag and a branch. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-09t/Makefile: include config.makLibravatar Jeff King1-0/+2
This is useful if you want to specify GIT_TEST_OPTS that you always use. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-09tests: allow user to specify trash directory locationLibravatar Jeff King1-1/+8
The tests generate a large amount of I/O activity creating and destroying repositories and files. We can improve the time it takes to run the test suite by creating trash directories on filesystems with better performance characteristic, even though we may not want the rest of the git repository on those filesystems (e.g., because they are not network connected, or because they are temporary ramdisks). For example, on a dual processor system: $ cd t && time make -j32 real 1m51.562s user 0m59.260s sys 1m20.933s # /dev/shm is tmpfs $ cd t && time make -j32 GIT_TEST_OPTS="--root=/dev/shm" real 1m1.484s user 0m53.555s sys 1m5.264s We almost halve the wall clock time, and we utilize the dual processors much better. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-09tests: provide $TRASH_DIRECTORY variableLibravatar Jeff King2-3/+3
Most scripts don't care about the absolute path to the trash directory. The one exception was t4014 script, which pieced together $TEST_DIRECTORY and $test itself to get an absolute directory. Instead, let's provide a $TRASH_DIRECTORY which specifies the same thing. This keeps the $test variable internal to test-lib.sh and paves the way for trash directories in other locations. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-09tests: use "$TEST_DIRECTORY" instead of ".."Libravatar Jeff King4-4/+4
The $TEST_DIRECTORY variable allows tests to find the top-level test directory regardless of the current working directory. In the past, this has been used to accomodate tests which change directories, but it is also the first step to being able to move trash directories outside of the $TEST_DIRECTORY hierarchy. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-09t0001-init: split the existence test from the permission testLibravatar Johannes Sixt1-0/+6
The test for correct permissions after init created a deep directory must be guarded by POSIXPERM. But testing that the deep dirctory exists is good even on platforms that do not provide the POSIXPERM prerequiste. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-09t0001-init: fix a file nameLibravatar Johannes Sixt1-1/+1
Without this change, grep fails because it does not find the file instead of because it does not find the text in the file. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-09t6035-merge-dir-to-symlink depends on SYMLINKS prerequisiteLibravatar Johannes Sixt1-0/+6
Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-07Merge branch 'maint'Libravatar Junio C Hamano1-3/+8
* maint: verify-pack -v: do not report "chain length 0" t5510: harden the way verify-pack is used
2009-08-07Merge branch 'maint-1.6.3' into maintLibravatar Junio C Hamano1-3/+8
* maint-1.6.3: verify-pack -v: do not report "chain length 0" t5510: harden the way verify-pack is used
2009-08-07Merge branch 'maint-1.6.2' into maint-1.6.3Libravatar Junio C Hamano1-3/+8
* maint-1.6.2: verify-pack -v: do not report "chain length 0" t5510: harden the way verify-pack is used
2009-08-07Merge branch 'maint-1.6.1' into maint-1.6.2Libravatar Junio C Hamano1-3/+8
* maint-1.6.1: verify-pack -v: do not report "chain length 0" t5510: harden the way verify-pack is used
2009-08-07Merge branch 'maint-1.6.0' into maint-1.6.1Libravatar Junio C Hamano1-3/+8
* maint-1.6.0: verify-pack -v: do not report "chain length 0" t5510: harden the way verify-pack is used
2009-08-07t5510: harden the way verify-pack is usedLibravatar Junio C Hamano1-3/+8
The test ignored the exit status from verify pack command, and also relied on not seeing any delta chain statistics. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-06am: allow individual e-mail files as inputLibravatar Junio C Hamano1-0/+15
We traditionally allowed a mbox file or a directory name of a maildir (but never an individual file inside a maildir) to be given to "git am". Even though an individual file in a maildir (or more generally, a piece of RFC2822 e-mail) is not a mbox file, it contains enough information to create a commit out of it, so there is no reason to reject one. Running mailsplit on such a file feels stupid, but it does not hurt. This builds on top of a5a6755 (git-am foreign patch support: introduce patch_format, 2009-05-27) that introduced mailbox format detection. The codepath to deal with a mbox requires it to begin with "From " line and also allows it to begin with "From: ", but a random piece of e-mail can and often do begin with any valid RFC2822 header lines. Instead of checking the first line, we extract all the lines up to the first empty line, and make sure they look like e-mail headers. A test is added to t4150 to demonstrate this feature. Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Brandon Casey <drafnel@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-05Merge branch 'jc/apply-epoch-patch'Libravatar Junio C Hamano1-0/+95
* jc/apply-epoch-patch: apply: notice creation/removal patches produced by GNU diff
2009-08-05Merge branch 'ns/init-mkdir'Libravatar Junio C Hamano1-0/+77
* ns/init-mkdir: git init: optionally allow a directory argument Conflicts: builtin-init-db.c
2009-08-05Merge branch 'sb/maint-pull-rebase'Libravatar Junio C Hamano1-0/+13
* sb/maint-pull-rebase: pull: support rebased upstream + fetch + pull --rebase t5520-pull: Test for rebased upstream + fetch + pull --rebase
2009-08-05Merge branch 'ne/futz-upload-pack'Libravatar Junio C Hamano1-2/+12
* ne/futz-upload-pack: Shift object enumeration out of upload-pack Conflicts: upload-pack.c
2009-08-05Merge branch 'maint'Libravatar Junio C Hamano1-0/+5
* maint: gitweb/README: Document $base_url Documentation: git submodule: add missing options to synopsis Better usage string for reflog. hg-to-git: don't import the unused popen2 module send-email: remove debug trace config: Keep inner whitespace verbatim
2009-08-05Merge branch 'maint-1.6.3' into maintLibravatar Junio C Hamano1-0/+5
* maint-1.6.3: Better usage string for reflog. hg-to-git: don't import the unused popen2 module send-email: remove debug trace config: Keep inner whitespace verbatim
2009-08-05git-merge-base/git-show-branch --merge-base: Documentation and testLibravatar Michael J Gruber1-0/+6
Currently, the documentation suggests that 'git merge-base -a' and 'git show-branch --merge-base' are equivalent (in fact it claims that the former cannot handle more than two revs). Alas, the handling of more than two revs is very different. Document this by tests and correct the documentation to reflect this. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-08-05t6010-merge-base.sh: Depict the octopus test graphLibravatar Michael J Gruber1-0/+12
...so that it is easier to reuse it for other tests. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-07-31config: Keep inner whitespace verbatimLibravatar Björn Steinbrink1-0/+5
Configuration values are expected to be quoted when they have leading or trailing whitespace, but inner whitespace should be kept verbatim even if the value is not quoted. This is already documented in git-config(1), but the code caused inner whitespace to be collapsed to a single space, breaking, for example, clones from a path that has two consecutive spaces in it, as future fetches would only see a single space. Reported-by: John te Bokkel <tanj.tanj@gmail.com> Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-07-30merge-recursive: don't segfault while handling rename clashesLibravatar Junio C Hamano1-0/+55
When a branch moves A to B while the other branch created B (or moved C to B), the code tried to rename one of them to B~something to preserve both versions, and failed to register temporary resolution for the original path B at stage#0 during virtual ancestor computation. This left the index in unmerged state and caused a segfault. A better solution is to merge these two versions of B's in place and use the (potentially conflicting) result as the intermediate merge result in the virtual ancestor. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-07-29git-checkout: be careful about untracked symlinksLibravatar Linus Torvalds1-1/+1
This fixes the case where an untracked symlink that points at a directory with tracked paths confuses the checkout logic, demostrated in t6035. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-07-29lstat_cache: guard against full match of length of 'name' parameterLibravatar Kjetil Barvik1-1/+1
longest_path_match() in symlinks.c does exactly what it's name says, but in some cases that match can be too long, since the has_*_leading_path() functions assumes that the match will newer be as long as the name string given to the function. fix this by adding an extra if test which checks if the match length is equal to the 'len' parameter. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-07-29Demonstrate bugs when a directory is replaced with a symlinkLibravatar Pickens, James E1-0/+87
This test creates two directories, a/b and a/b-2, then replaces a/b with a symlink to a/b-2, then merges that change into the 'baseline' commit, which contains an unrelated change. There are two bugs: 1. 'git checkout' incorrectly deletes work tree file a/b-2/d. 2. 'git merge' incorrectly deletes work tree file a/b-2/d. The test goes on to create another branch in which a/b-2 is replaced with a symlink to a/b (i.e., the reverse of what was done the first time), and merge it into the 'baseline' commit. There is a different bug: 3. The merge should be clean, but git reports a conflict. Signed-off-by: James Pickens <james.e.pickens@intel.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-07-29clean: require double -f options to nuke nested git repository and work treeLibravatar Junio C Hamano1-0/+39
When you have an embedded git work tree in your work tree (be it an orphaned submodule, or an independent checkout of an unrelated project), "git clean -d -f" blindly descended into it and removed everything. This is rarely what the user wants. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-07-29Merge branch 'hv/cvsps-tests'Libravatar Junio C Hamano28-33/+1627
* hv/cvsps-tests: t/t9600: remove exit after test_done cvsimport: extend testcase about patchset order to contain branches cvsimport: add test illustrating a bug in cvsps Add a test of "git cvsimport"'s handling of tags and branches Add some tests of git-cvsimport's handling of vendor branches Test contents of entire cvsimported "master" tree contents Use CVS's -f option if available (ignore user's ~/.cvsrc file) Start a library for cvsimport-related tests
2009-07-29Add a reminder test case for a merge with F/D transitionLibravatar Alex Riesen1-0/+23
The problem is that if a file was replaced with a directory containing another file with the same content and mode, an attempt to merge it with a branch descended from a commit before this F->D transition will cause merge-recursive to break. It breaks even if there were no conflicting changes on that other branch. Originally reported by Anders Melchiorsen. Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-07-26t9143: do not fail if Compress::Zlib is missingLibravatar Eric Wong1-3/+12
"git svn gc" will not compress unhandled.log files if Compress::Zlib is missing. However, leftover index files should always be removed, so add a test for this behavior as well. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-07-26Merge branch 'gp/maint-rebase-p-onto'Libravatar Junio C Hamano1-0/+80
* gp/maint-rebase-p-onto: Fix rebase -p --onto
2009-07-26Merge branch 'en/fast-export'Libravatar Junio C Hamano1-1/+95
* en/fast-export: fast-export: Document the fact that git-rev-list arguments are accepted Add new fast-export testcases fast-export: Add a --tag-of-filtered-object option for newly dangling tags fast-export: Do parent rewriting to avoid dropping relevant commits fast-export: Make sure we show actual ref names instead of "(null)" fast-export: Omit tags that tag trees fast-export: Set revs.topo_order before calling setup_revisions
2009-07-25t9142: stop httpd after the testLibravatar Eric Wong1-0/+2
Otherwise it would fail in subsequent runs if the same SVN_HTTPD_PORT was used. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2009-07-25git svn: the branch command no longer needs the full pathLibravatar Eric Wong1-4/+4
This was introduced in 0b2af457a49e3b00d47d556d5301934d27909db8 ("Fix branch detection when repository root is inaccessible") but reintroduced in the previous commit. Signed-off-by: Eric Wong <normalperson@yhbt.net>