summaryrefslogtreecommitdiff
path: root/t
AgeCommit message (Collapse)AuthorFilesLines
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-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-07submodule: warn about non-submodulesLibravatar Johannes Schindelin1-0/+7
Earlier, when you called git submodule some/bogus/path Git would silently ignore the path, without warning the user about the likely mistake. Now it does. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-07Let ls-files strip trailing slashes in submodules' pathsLibravatar Johannes Schindelin1-0/+6
Tab completion makes it easy to add a trailing slash to a submodule path. As it is completely clear what the user actually wanted to say, be nice and strip that slash at the end. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-07Test and fix normalize_path_copy()Libravatar Johannes Sixt1-16/+17
This changes the test-path-utils utility to invoke normalize_path_copy() instead of normalize_absolute_path() because the latter is about to be removed. The test cases in t0060 are adjusted in two regards: - normalize_path_copy() more often leaves a trailing slash in the result. This has no negative side effects because the new user of this function, longest_ancester_length(), already accounts for this behavior. - The function can fail. The tests uncover a flaw in normalize_path_copy(): If there are sufficiently many '..' path components so that the root is reached, such as in "/d1/s1/../../d2", then the leading slash was lost. This manifested itself that (assuming there is a repository at /tmp/foo) $ git add /d1/../tmp/foo/some-file reported 'pathspec is outside repository'. This is now fixed. Moreover, the test case descriptions of t0060 now include the test data and expected outcome. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-07Fix GIT_CEILING_DIRECTORIES on WindowsLibravatar René Scharfe1-3/+3
Using git with GIT_CEILING_DIRECTORIES crashed on Windows due to a failed assertion in normalize_absolute_path(): This function expects absolute paths to start with a slash, while on Windows they can start with a drive letter or a backslash. This fixes it by using the alternative, normalize_path_copy() instead, which can handle Windows-style paths just fine. Secondly, the portability macro PATH_SEP is used instead of expecting colons to be used as path list delimiter. The test script t1504 is also changed to help MSYS's bash recognize some program arguments as path list. (MSYS's bash must translate POSIX-style path lists to Windows-style path lists, and the heuristic did not catch some cases.) Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-07Merge branch 'js/filter-branch-submodule'Libravatar Junio C Hamano1-1/+3
* js/filter-branch-submodule: filter-branch: do not consider diverging submodules a 'dirty worktree' filter-branch: Fix fatal error on bare repositories
2009-02-05Merge branch 'js/maint-remote-remove-mirror'Libravatar Junio C Hamano1-0/+26
* js/maint-remote-remove-mirror: builtin-remote: make rm operation safer in mirrored repository builtin-remote: make rm() use properly named variable to hold return value
2009-02-05Merge branch 'js/notes'Libravatar Junio C Hamano2-0/+193
* js/notes: git-notes: fix printing of multi-line notes notes: fix core.notesRef documentation Add an expensive test for git-notes Speed up git notes lookup Add a script to edit/inspect notes Introduce commit notes Conflicts: pretty.c
2009-02-05Merge branch 'jc/refuse-push-to-current'Libravatar Junio C Hamano1-3/+3
* jc/refuse-push-to-current: receive-pack: explain what to do when push updates the current branch
2009-02-05Merge branch 'jk/head-symref'Libravatar Junio C Hamano1-0/+41
* jk/head-symref: symbolic ref: refuse non-ref targets in HEAD validate_headref: tighten ref-matching to just branches
2009-02-05Merge branch 'cb/mergetool'Libravatar Junio C Hamano1-16/+59
* cb/mergetool: mergetool: fix running mergetool in sub-directories mergetool: Add a test for running mergetool in a sub-directory mergetool: respect autocrlf by using checkout-index
2009-02-04Merge branch 'jc/fsck' (early part)Libravatar Junio C Hamano1-0/+31
* 'jc/fsck' (early part): fsck: check loose objects from alternate object stores by default fsck: HEAD is part of refs
2009-02-04Merge branch 'maint'Libravatar Junio C Hamano1-1/+9
* maint: urls.txt: document optional port specification in git URLS builtin-mv.c: check for unversionned files before looking at the destination. Add a testcase for "git mv -f" on untracked files. Missing && in t/t7001.sh.
2009-02-04Merge branch 'ns/am-slacker'Libravatar Junio C Hamano1-0/+33
* ns/am-slacker: git-am: Add --ignore-date option am: Add --committer-date-is-author-date option Conflicts: git-am.sh
2009-02-04Merge branch 'maint-1.6.0' into maintLibravatar Junio C Hamano1-1/+9
* maint-1.6.0: builtin-mv.c: check for unversionned files before looking at the destination. Add a testcase for "git mv -f" on untracked files. Missing && in t/t7001.sh.
2009-02-04builtin-mv.c: check for unversionned files before looking at the destination.Libravatar Matthieu Moy1-1/+1
The previous code was failing in the case where one moves an unversionned file to an existing destination, with mv -f: the "existing destination" was checked first, and the error was cancelled by the force flag. We now check the unrecoverable error first, which fixes the bug. Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-04Add a testcase for "git mv -f" on untracked files.Libravatar Matthieu Moy1-0/+8
This currently fails with: git: builtin-mv.c:217: cmd_mv: Assertion `pos >= 0' failed. Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-04Missing && in t/t7001.sh.Libravatar Matthieu Moy1-1/+1
Without this, the exit status is only the one of the last line. Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-04builtin-remote: make rm operation safer in mirrored repositoryLibravatar Jay Soffian1-0/+26
"git remote rm <repo>" happily removes non-remote refs and their reflogs. This may be okay if the repository truely is a mirror, but if the user had done "git remote add --mirror <repo>" by accident and was just undoing their mistake, then they are left in a situation that is difficult to recover from. After this commit, "git remote rm" skips over non-remote refs. The user is advised on how remove branches using "git branch -d", which itself has nice safety checks wrt to branch removal lacking from "git remote rm". Non-remote non-branch refs are skipped silently. Signed-off-by: Jay Soffian <jaysoffian@gmail.com> Acked-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-03filter-branch: Fix fatal error on bare repositoriesLibravatar Eric Kidd1-1/+3
When git filter-branch is run on a bare repository, it prints out a fatal error message: $ git filter-branch branch Rewrite 476c4839280c219c2317376b661d9d95c1727fc3 (9/9) WARNING: Ref 'refs/heads/branch' is unchanged fatal: This operation must be run in a work tree Note that this fatal error message doesn't prevent git filter-branch from exiting successfully. (Why doesn't git filter-branch actually exit with an error when a shell command fails? I'm not sure why it was designed this way.) This error message is caused by the following section of code at the end of git-filter-branch.sh: if [ "$(is_bare_repository)" = false ]; then unset GIT_DIR GIT_WORK_TREE GIT_INDEX_FILE test -z "$ORIG_GIT_DIR" || { GIT_DIR="$ORIG_GIT_DIR" && export GIT_DIR } ... elided ... git read-tree -u -m HEAD fi The problem is the call to $(is_bare_repository), which is made before GIT_DIR and GIT_WORK_TREE are restored. This call always returns "false", even when we're running in a bare repository. But this means that we will attempt to call 'git read-tree' even in a bare repository, which will fail and print an error. This patch modifies git-filter-branch.sh to restore the original environment variables before trying to call is_bare_repository. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-03tests: fix test_commit() for case insensitive filesystemsLibravatar Junio C Hamano1-1/+1
Brian Gernhardt noticed that t3411 was broken recently on case insensitive filesystems. 0088496 (test-lib.sh: introduce test_commit() and test_merge() helpers, 2009-01-27) used a tag and a file with the same name, only different in case, and converted many existing tests that needed only a file (or a tag). Some tests may want to refer to a rev or a file, but on a filesystem that loses cases, referring to either without disambiguation mark ("--") on the command line now triggers an error (t3411 was the only one such test). Fix it by using a filename that is different from the tagname each step creates. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-03t3412: further simplify setting of GIT_EDITORLibravatar Junio C Hamano1-4/+0
2182896 (t3412: clean up GIT_EDITOR usage, 2009-01-30) tried to clean up the script's use of GIT_EDITOR, but it can further be simplified, because that is how test-lib.sh sets things up already. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-03receive-pack: explain what to do when push updates the current branchLibravatar Junio C Hamano1-3/+3
This makes "git push" issue a more detailed instruction when a user pushes into the current branch of a non-bare repository without having an explicit configuration set to receive.denycurrentbranch. In such a case, it will also tell the user that the default will change to refusal in a future version of git. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-03Merge branch 'jc/maint-add-u-remove-conflicted'Libravatar Junio C Hamano1-1/+49
* jc/maint-add-u-remove-conflicted: add -u: do not fail to resolve a path as deleted
2009-02-01t3412: use log|name-rev instead of log --graphLibravatar Thomas Rast1-26/+39
Replace all 'git log --graph' calls for history verification with the combination of 'git log ...| git name-rev' first introduced by a6c7a27 (rebase -i: correctly remember --root flag across --continue, 2009-01-26). This should be less susceptible to format changes than the --graph code. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-01mailinfo: cleanup extra spaces for complex 'From:'Libravatar Kirill Smelkov3-4/+4
currently for cases like From: A U Thor <a.u.thor@example.com> (Comment) mailinfo extracts the following 'Author:' field: Author: A U Thor (Comment) ^^ which has two extra spaces left in there after removed email part. I think this is wrong so here is a fix. Signed-off-by: Kirill Smelkov <kirr@landau.phys.spbu.ru> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-31Merge branch 'ks/maint-mailinfo-folded'Libravatar Junio C Hamano21-2/+209
* ks/maint-mailinfo-folded: mailinfo: tests for RFC2047 examples mailinfo: add explicit test for mails like '<a.u.thor@example.com> (A U Thor)' mailinfo: 'From:' header should be unfold as well mailinfo: correctly handle multiline 'Subject:' header
2009-01-31Merge branch 'jc/maint-allow-uninteresting-missing'Libravatar Junio C Hamano1-0/+37
* jc/maint-allow-uninteresting-missing: revision traversal: allow UNINTERESTING objects to be missing
2009-01-31Merge branch 'jg/tag-contains'Libravatar Junio C Hamano1-0/+115
* jg/tag-contains: git-tag: Add --contains option Make has_commit() non-static Make opt_parse_with_commit() non-static
2009-01-31Merge branch 'js/maint-rebase-i-submodule'Libravatar Junio C Hamano1-0/+26
* js/maint-rebase-i-submodule: Fix submodule squashing into unrelated commit rebase -i squashes submodule changes into unrelated commit
2009-01-31Merge branch 'jc/maint-split-diff-metainfo'Libravatar Junio C Hamano2-1/+19
* jc/maint-split-diff-metainfo: diff.c: output correct index lines for a split diff
2009-01-31Merge branch 'jk/signal-cleanup'Libravatar Junio C Hamano1-0/+22
* jk/signal-cleanup: t0005: use SIGTERM for sigchain test pager: do wait_for_pager on signal death refactor signal handling for cleanup functions chain kill signals for cleanup functions diff: refactor tempfile cleanup handling Windows: Fix signal numbers
2009-01-31mergetool: fix running mergetool in sub-directoriesLibravatar Charles Bailey1-1/+1
The previous fix to mergetool to use checkout-index instead of cat-file broke running mergetool anywhere except the root of the repository. This fixes it by using the correct relative paths for temporary files and index paths. Signed-off-by: Charles Bailey <charles@hashpling.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-31mergetool: Add a test for running mergetool in a sub-directoryLibravatar Charles Bailey1-19/+51
Signed-off-by: Charles Bailey <charles@hashpling.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-30t3412: clean up GIT_EDITOR usageLibravatar Thomas Rast1-25/+13
a6c7a27 (rebase -i: correctly remember --root flag across --continue, 2009-01-26) introduced a more portable GIT_EDITOR usage, but left the old tests unchanged. Since we never use the editor (all tests run the rebase script as proposed by rebase -i), just disable it outright, which simplifies the tests. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-30Fix 'git diff --no-index' with a non-existing symlink targetLibravatar Johannes Schindelin1-0/+7
When trying to find out mode changes, we should not access the symlink targets using stat(); instead we use lstat() so that the diff does not fail trying to find a non-existing symlink target. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-30fsck: check loose objects from alternate object stores by defaultLibravatar Junio C Hamano1-0/+12
"git fsck" used to validate only loose objects that are local and nothing else by default. This is not just too little when a repository is borrowing objects from other object stores, but also caused the connectivity check to mistakenly declare loose objects borrowed from them to be missing. The rationale behind the default mode that validates only loose objects is because these objects are still young and more unlikely to have been pushed to other repositories yet. That holds for loose objects borrowed from alternate object stores as well. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-30fsck: HEAD is part of refsLibravatar Junio C Hamano1-0/+19
By default we looked at all refs but not HEAD. The only thing that made fsck not lose sight of commits that are only reachable from a detached HEAD was the reflog for the HEAD. This fixes it, with a new test. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-30t0005: use SIGTERM for sigchain testLibravatar Jeff King1-1/+1
The signal tests consists of checking that each of our handlers is executed, and that the test program was killed by the final signal. We arbitrarily used SIGINT as the kill signal. However, some platforms (notably Solaris) will default SIGINT to SIG_IGN if there is no controlling terminal. In that case, we don't end up killing the program with the final signal and the test fails. This is a problem since the test script should not depend on outside factors; let's use SIGTERM instead, which should behave consistently. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-29symbolic ref: refuse non-ref targets in HEADLibravatar Jeff King1-0/+41
When calling "git symbolic-ref" it is easy to forget that the target must be a fully qualified ref. E.g., you might accidentally do: $ git symbolic-ref HEAD master Unfortunately, this is very difficult to recover from, because the bogus contents of HEAD make git believe we are no longer in a git repository (as is_git_dir explicitly checks for "^refs/heads/" in the HEAD target). So immediately trying to fix the situation doesn't work: $ git symbolic-ref HEAD refs/heads/master fatal: Not a git repository and one is left editing the .git/HEAD file manually. Furthermore, one might be tempted to use symbolic-ref to set up a detached HEAD: $ git symbolic-ref HEAD `git rev-parse HEAD` which sets up an even more bogus HEAD: $ cat .git/HEAD ref: 1a9ace4f2ad4176148e61b5a85cd63d5604aac6d This patch introduces a small safety valve to prevent the specific case of anything not starting with refs/heads/ to go into HEAD. The scope of the safety valve is intentionally very limited, to make sure that we are not preventing any behavior that would otherwise be valid (like pointing a different symref than HEAD outside of refs/heads/). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-28Merge branch 'jc/maint-format-patch-o-relative' into maintLibravatar Junio C Hamano1-1/+51
* jc/maint-format-patch-o-relative: Teach format-patch to handle output directory relative to cwd Conflicts: t/t4014-format-patch.sh
2009-01-28Merge branch 'nd/grep-assume-unchanged' into maintLibravatar Junio C Hamano1-0/+7
* nd/grep-assume-unchanged: grep: grep cache entries if they are "assume unchanged" grep: support --no-ext-grep to test builtin grep