summaryrefslogtreecommitdiff
path: root/t
AgeCommit message (Collapse)AuthorFilesLines
2009-04-05t/t9600: remove exit after test_doneLibravatar Junio C Hamano1-3/+0
This cherry-picks part of 5dba35912474770d0df45ed801d78c4c9ed5e949 Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-20cvsimport: extend testcase about patchset order to contain branchesLibravatar Heiko Voigt4-11/+103
This makes sure that timestamps and ordering on branches is not influenced by a fix for cvsps. The test extension does not deal which patchset correction on branches it only verifes that branches are basically handled as before. Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-20cvsimport: add test illustrating a bug in cvspsLibravatar Heiko Voigt4-0/+115
Some cvs repositories may have time deviations in their recorded commits. This is a test for one of such cases. These kind of repositories can happen if the system time of cvs clients is not fully synchronised. Consider the following sequence of events: * client A commits file a r1.1 * client A commits file a r1.2, b r1.1 * client B commits file b r1.2 using the same timestamp as a r1.1 This can be resolved but due to cvsps ordering its patchsets solely based on the timestamp. It only takes revision odering into account if there is no difference in the timestamp. I hit this bug when importing from a real repository which was originally converted from another rcs based scm. Other import tools can handle this correctly, e.g. parsecvs. Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-23Add a test of "git cvsimport"'s handling of tags and branchesLibravatar Michael Haggerty12-0/+921
6 out of 11 of these tests fail. The test CVS repository used for these tests is derived from one in cvs2svn's test suite. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-23Add some tests of git-cvsimport's handling of vendor branchesLibravatar Michael Haggerty9-0/+413
CVS's handling of vendor branches is tricky; add some tests to check whether revisions added via "cvs imports" then imported to git via "git cvsimport" are reflected correctly on master. One of these tests fail and is therefore marked "test_expect_failure". Cvsimport doesn't realize that subsequent changes on a vendor branch affect master as long as the vendor branch is the default branch. The test CVS repository used for these tests is derived from cvs2svn's test suite. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-23Test contents of entire cvsimported "master" tree contentsLibravatar Michael Haggerty2-0/+46
Test added for completeness (it passes). Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-23Use CVS's -f option if available (ignore user's ~/.cvsrc file)Libravatar Michael Haggerty2-8/+11
A user's ~/.cvsrc file can change the basic behavior of CVS commands. Therefore we should ignore it in order to ensure consistent results from the test suite. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-23Start a library for cvsimport-related testsLibravatar Michael Haggerty2-28/+32
For now the library just includes code (moved from t/t9600-cvsimport.sh) that checks whether the prerequisites for "git cvsimport" are installed. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-19Introduce the function strip_path_suffix()Libravatar Johannes Schindelin1-0/+4
The function strip_path_suffix() will try to strip a given suffix from a given path. The suffix must start at a directory boundary (i.e. "core" is not a path suffix of "libexec/git-core", but "git-core" is). Arbitrary runs of directory separators ("slashes") are assumed identical. Example: strip_path_suffix("C:\\msysgit/\\libexec\\git-core", "libexec///git-core", &prefix) will set prefix to "C:\\msysgit" and return 0. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Acked-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-18Merge branch 'maint'Libravatar Junio C Hamano4-3/+10
* maint: tests: fix "export var=val" Skip timestamp differences for diff --no-index Documentation/git-push: --all, --mirror, --tags can not be combined
2009-02-18tests: fix "export var=val"Libravatar Junio C Hamano2-3/+3
Some shells do not like "export var=val"; the right way to write it is to do an assignment and then export just the variable name. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-18filter-branch -d: Export GIT_DIR earlierLibravatar Lars Noschinski1-0/+12
The improved error handling catches a bug in filter-branch when using -d pointing to a path outside any git repository: $ git filter-branch -d /tmp/foo master fatal: Not a git repository (or any of the parent directories): .git This error message comes from git for-each-ref in line 224. GIT_DIR is set correctly by git-sh-setup (to the foo.git repository), but not exported (yet). Signed-off-by: Lars Noschinski <lars@public.noschinski.de> Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-18Skip timestamp differences for diff --no-indexLibravatar Michael Spang2-0/+7
We display empty diffs for files whose timestamps have changed. Usually, refreshing the index makes those empty diffs go away. However, when not using the index they are not very useful and there is no option to suppress them. This forces on the skip_stat_unmatch option for diff --no-index, suppressing any empty diffs. This option is also used for diffs against the index when "diff.autorefreshindex" is set, but that option does not apply to diff --no-index. Signed-off-by: Michael Spang <mspang@uwaterloo.ca> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-18gitweb: Fix warnings with override permitted but no repo overrideLibravatar Marcel M. Cary1-1/+17
When a feature like "blame" is permitted to be overridden in the repository configuration but it is not actually set in the repository, a warning is emitted due to the undefined value of the repository configuration, even though it's a perfectly normal condition. Emitting warning is grounds for test failure in the gitweb test script. This error was caused by rewrite of git_get_project_config from using "git config [<type>] <name>" for each individual configuration variable checked to parsing "git config --list --null" output in commit b201927 (gitweb: Read repo config using 'git config -z -l'). Earlier version of git_get_project_config was returning empty string if variable do not exist in config; newer version is meant to return undef in this case, therefore change in feature_bool was needed. Additionally config_to_* subroutines were meant to be invoked only if configuration variable exists; therefore we added early return to git_get_project_config: it now returns no value if variable does not exists in config. Otherwise config_to_* subroutines (config_to_bool in paryicular) wouldn't be able to distinguish between the case where variable does not exist and the case where variable doesn't have value (the "[section] noval" case, which evaluates to true for boolean). While at it fix bug in config_to_bool, where checking if $val is defined (if config variable has value) was done _after_ stripping leading and trailing whitespace, which lead to 'Use of uninitialized value' warning. Add test case for features overridable but not overriden in repo config, and case for no value boolean configuration variable. Signed-off-by: Marcel M. Cary <marcel@oak.homeunix.org> Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-16gitweb: fix wrong base URL when non-root DirectoryIndexLibravatar Giuseppe Bilotta1-2/+4
CGI::url() has some issues when rebuilding the script URL if the script is a DirectoryIndex. One of these issue is the inability to strip PATH_INFO, which is why we had to do it ourselves. Another issue is that the resulting URL cannot be used for the <base> tag: it works if we're the DirectoryIndex at the root level, but not otherwise. We fix this by building the proper base URL ourselves, and improve the comment about the need to strip PATH_INFO manually while we're at it. Additionally t/t9500-gitweb-standalone-no-errors.sh had to be modified to set SCRIPT_NAME variable (CGI standard states that it MUST be set, and now gitweb uses it if PATH_INFO is not empty, as is the case for some of tests in t9500). Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com> Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-15Merge branch 'mc/setup-cd-p'Libravatar Junio C Hamano1-2/+2
* mc/setup-cd-p: git-sh-setup: Use "cd" option, not /bin/pwd, for symlinked work tree
2009-02-15Merge branch 'ms/mailmap'Libravatar Junio C Hamano1-0/+215
* ms/mailmap: Move mailmap documentation into separate file Change current mailmap usage to do matching on both name and email of author/committer. Add map_user() and clear_mailmap() to mailmap Add find_insert_index, insert_at_index and clear_func functions to string_list Add mailmap.file as configurational option for mailmap location
2009-02-15Merge branch 'rc/http-push'Libravatar Junio C Hamano1-0/+7
* rc/http-push: use a hash of the lock token as the suffix for PUT/MOVE
2009-02-15use a hash of the lock token as the suffix for PUT/MOVELibravatar Tay Ray Chuan1-0/+7
After 753bc91 ("Remove the requirement opaquelocktoken uri scheme"), lock tokens are in the URI forms in which they are received from the server, eg. 'opaquelocktoken:', 'urn:uuid:'. However, "start_put" (and consequently "start_move"), which attempts to create a unique temporary file using the UUID of the lock token, inadvertently uses the lock token in its URI form. These file operations on the server may not be successful (specifically, in Windows), due to the colon ':' character from the URI form of the lock token in the file path. This patch uses a hash of the lock token instead, guaranteeing only "safe" characters (a-f, 0-9) are used in the file path. The token's hash is generated when the lock token is received from the server in handle_new_lock_ctx, minimizing the number of times of hashing. Signed-off-by: Tay Ray Chuan <rctay89@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-15Merge branch 'js/gc-prune'Libravatar Junio C Hamano1-0/+38
* js/gc-prune: gc: make --prune useful again by accepting an optional parameter
2009-02-15Merge branch 'tr/abbrev-commit-no-ellipses'Libravatar Junio C Hamano14-14/+14
* tr/abbrev-commit-no-ellipses: log: do not print ellipses with --abbrev-commit
2009-02-15Merge branch 'jc/branch-previous'Libravatar Junio C Hamano1-0/+49
* jc/branch-previous: Teach @{-1} to git merge Teach the "@{-1} syntax to "git branch"
2009-02-14t1500: more 'git rev-parse --git-dir' testsLibravatar SZEDER Gábor1-3/+3
Extend t1500 with tests of 'git rev-parse --git-dir' when invoked from other directories of the repository or the work tree. Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-14Move 'rev-parse --git-dir' test to t1500Libravatar SZEDER Gábor2-9/+9
Commit 72183cb2 (Fix gitdir detection when in subdir of gitdir, 2009-01-16) added a test to 't1501-worktree' to check the behaviour of 'git rev-parse --git-dir' in a special case. However, t1501 is about testing separate work tree setups, and not about basic 'rev-parse' functionality, which is tested in t1500-rev-parse. Therefore, this patch moves that test to t1500. Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-14gc: make --prune useful again by accepting an optional parameterLibravatar Johannes Schindelin1-0/+38
With this patch, "git gc --no-prune" will not prune any loose (and dangling) object, and "git gc --prune=5.minutes.ago" will prune all loose objects older than 5 minutes. This patch benefitted from suggestions by Thomas Rast and Jan Krï¿œger. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-13Teach @{-1} to git mergeLibravatar Junio C Hamano1-0/+23
1.6.2 will have @{-1} syntax advertised as "usable anywhere you can use a branch name". However, "git merge @{-1}" did not work. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-13Teach the "@{-1} syntax to "git branch"Libravatar Junio C Hamano1-0/+26
This teaches the new "@{-1} syntax to refer to the previous branch to "git branch". After looking at somebody's faulty patch series on a topic branch too long, if you decide it is not worth merging, you can just say: $ git checkout master $ git branch -D @{-1} to get rid of it without having to type the name of the topic you now hate so much for wasting a lot of your time. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-13symbolic-ref: allow refs/<whatever> in HEADLibravatar Jeff King1-5/+0
Commit afe5d3d5 introduced a safety valve to symbolic-ref to disallow installing an invalid HEAD. It was accompanied by b229d18a, which changed validate_headref to require that HEAD contain a pointer to refs/heads/ instead of just refs/. Therefore, the safety valve also checked for refs/heads/. As it turns out, topgit is using refs/top-bases/ in HEAD, leading us to re-loosen (at least temporarily) the validate_headref check made in b229d18a. This patch does the corresponding loosening for the symbolic-ref safety valve, so that the two are in agreement once more. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-13log: do not print ellipses with --abbrev-commitLibravatar Thomas Rast14-14/+14
'git log --abbrev-commit' added an ellipsis to all commit names that were abbreviated. This was particularly annoying if you wanted to cut&paste the sha1 from the terminal, since selecting by word would pick up '...' too. So use find_unique_abbrev() instead of diff_unique_abbrev() in all log-related commit sha1 printing routines, and also change the formatting of the 'Merge: parent1 parent2' line output via pretty_print_commit(). Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-12Install the default "master" branch configuration after cloning a voidLibravatar Junio C Hamano1-0/+15
After "cloning from an empty repository", we have a configuration to describe the remote's URL and the default ref mappings, but we lack the branch configuration for the default branch we create on our end, "master". It is likely that the empty repository we cloned from will point the default "master" branch with its HEAD, so prepare the local configuration to match. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-12Bugfix: GIT_EXTERNAL_DIFF with more than one changed filesLibravatar Nazri Ramliy1-0/+8
When there is more than one file that are changed, running git diff with GIT_EXTERNAL_DIFF incorrectly diagnoses an programming error and dies. The check introduced in 479b0ae (diff: refactor tempfile cleanup handling, 2009-01-22) to detect a temporary file slot that forgot to remove its temporary file was inconsistent with the way the codepath to remove the temporary to mark the slot that it is done with it. This patch fixes this problem and adds a test case for it. Signed-off-by: Nazri Ramliy <ayiehere@gmail.com> Acked-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-11filter-branch: Add more error-handlingLibravatar Eric Kidd1-0/+4
9273b56 (filter-branch: Fix fatal error on bare repositories, 2009-02-03) fixed a missing check of return status from an underlying command in git-filter-branch, but there still are places that do not check errors. For example, the command does not pay attention to the exit status of the command given by --commit-filter. It should abort in such a case. This attempts to fix all the remaining places that fails to checks errors. In two places, I've had to break apart pipelines in order to check the error code for the first stage of the pipeline, as discussed here: http://kerneltrap.org/mailarchive/git/2009/1/28/4835614 Feedback on this patch was provided by Johannes Sixt, Johannes Schindelin and Junio C Hamano. Thomas Rast helped with pipeline error handling. Signed-off-by: Eric Kidd <git@randomhacks.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-11Merge git://git.bogomips.org/git-svnLibravatar Junio C Hamano3-0/+218
* git://git.bogomips.org/git-svn: test case for regression caused by git-svn empty symlink fix git-svn: fix broken symlink workaround when switching branches git-svn: Print revision while searching for earliest use of path git-svn: abstract out a block into new method other_gs() git-svn: allow disabling expensive broken symlink checks
2009-02-11test case for regression caused by git-svn empty symlink fixLibravatar Anton Gyllenberg2-0/+208
Commit dbc6c74d0858d77e61e092a48d467e725211f8e9 "git-svn: handle empty files marked as symlinks in SVN" caused a regression in an unusual case where a branch has been created in SVN, later deleted and then created again from another branch point and the original branch point had empty files not in the new branch. In some cases git svn fetch will then fail while trying to fetch the empty file from the wrong SVN revision. This adds a test case that reproduces the issue. [ew: added additional test to ensure file was created correctly made test file executable ] Signed-off-by: Anton Gyllenberg <anton@iki.fi> Acked-by: Eric Wong <normalperson@yhbt.net>
2009-02-11git-svn: allow disabling expensive broken symlink checksLibravatar Eric Wong1-0/+10
Since dbc6c74d0858d77e61e092a48d467e725211f8e9, git-svn has had an expensive check for broken symlinks that exist in some repositories. This leads to a heavy performance hit on repositories with many empty blobs that are not supposed to be symlinks. The workaround is enabled by default; and may be disabled via: git config svn.brokenSymlinkWorkaround false Reported by Markus Heidelberg. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2009-02-11Merge branch 'maint'Libravatar Junio C Hamano1-0/+39
* maint: revision traversal and pack: notice and die on missing commit
2009-02-11Merge branch 'maint-1.5.6' into maintLibravatar Junio C Hamano1-0/+39
* maint-1.5.6: revision traversal and pack: notice and die on missing commit
2009-02-11Merge branch 'maint-1.5.5' into maint-1.5.6Libravatar Junio C Hamano1-0/+39
* maint-1.5.5: revision traversal and pack: notice and die on missing commit Conflicts: revision.c
2009-02-11Merge branch 'maint-1.5.4' into maint-1.5.5Libravatar Junio C Hamano1-0/+39
* maint-1.5.4: revision traversal and pack: notice and die on missing commit
2009-02-11revision traversal and pack: notice and die on missing commitLibravatar Junio C Hamano1-0/+39
cc0e6c5 (Handle return code of parse_commit in revision machinery, 2007-05-04) attempted to tighten error checking in the revision machinery, but it wasn't enough. When get_revision_1() was asked for the next commit to return, it tries to read and simplify the parents of the commit to be returned, but an error while doing so was silently ignored and reported as a truncated history to the caller instead. This resulted in an early end of "git log" output or a pack that lacks older commits from "git pack-objects", without any error indication in the exit status from these commands, even though the underlying parse_commit() issues an error message to the end user. Note that the codepath in add_parents_list() that paints parents of an UNINTERESTING commit UNINTERESTING silently ignores the error when parse_commit() fails; this is deliberate and in line with aeeae1b (revision traversal: allow UNINTERESTING objects to be missing, 2009-01-27). Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-10receive-pack: receive.denyDeleteCurrentLibravatar Junio C Hamano1-0/+13
This is a companion patch to the recent 3d95d92 (receive-pack: explain what to do when push updates the current branch, 2009-01-31). Deleting the current branch from a remote will result in the next clone from it not check out anything, among other things. It also is one of the cause that makes remotes/origin/HEAD a dangling symbolic ref. This patch still allows the traditional behaviour but with a big warning, and promises that the default will change to 'refuse' in a future release. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-10Warn use of "origin" when remotes/origin/HEAD is danglingLibravatar Junio C Hamano1-0/+6
The previous one squelched the diagnositic message we used to issue every time we enumerated the refs and noticed a dangling ref. This adds the warning back to the place where the user actually attempts to use it. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-10remote prune: warn dangling symrefsLibravatar Junio C Hamano1-0/+21
If you prune from the remote "frotz" that deleted the ref your tracking branch remotes/frotz/HEAD points at, the symbolic ref will become dangling. We used to detect this as an error condition and issued a message every time refs are enumerated. This stops the error message, but moves the warning to "remote prune". Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-10Modernize t5400 test scriptLibravatar Junio C Hamano1-86/+94
Many tests checked for failure by hand without using test_must_fail (they probably predate the shell function). When we know the desired outcome, explicitly check for it, instead of checking if the result does not match one possible incorrect outcome. E.g. if you expect a push to be refused, you do not test if the result is different from what was pushed. Instead, make sure that the ref did not before and after the push. The test sequence chdir'ed around and any failure at one point could have started the next test in an unexpected directory. Fix this problem by using subshells as necessary. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-10Revert "Merge branch 'js/notes'"Libravatar Junio C Hamano2-193/+0
This reverts commit 7b75b331f6744fbf953fe8913703378ef86a2189, reversing changes made to 5d680a67d7909c89af96eba4a2d77abed606292b.
2009-02-10Merge branch 'js/git-submodule-trailing-slash'Libravatar Junio C Hamano1-0/+13
* js/git-submodule-trailing-slash: submodule: warn about non-submodules Let ls-files strip trailing slashes in submodules' paths
2009-02-10Merge branch 'js/maint-1.6.0-path-normalize'Libravatar Junio C Hamano2-19/+20
* js/maint-1.6.0-path-normalize: Remove unused normalize_absolute_path() Test and fix normalize_path_copy() Fix GIT_CEILING_DIRECTORIES on Windows Move sanitary_path_copy() to path.c and rename it to normalize_path_copy() Make test-path-utils more robust against incorrect use
2009-02-08Add two extra tests for git rebaseLibravatar Johannes Schindelin1-1/+12
2009-02-08Change current mailmap usage to do matching on both name and email of ↵Libravatar Marius Storm-Olsen1-0/+106
author/committer. Signed-off-by: Marius Storm-Olsen <marius@trolltech.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-08Add mailmap.file as configurational option for mailmap locationLibravatar Marius Storm-Olsen1-0/+109
This allows us to augment the repo mailmap file, and to use mailmap files elsewhere than the repository root. Meaning that the entries in mailmap.file will override the entries in "./.mailmap", should they match. Signed-off-by: Marius Storm-Olsen <marius@trolltech.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>