summaryrefslogtreecommitdiff
path: root/t/t5400-send-pack.sh
AgeCommit message (Collapse)Author
2010-11-03Change remote tracking to remote-tracking in non-trivial placesMatthieu Moy
To complement the straightforward perl application in previous patch, this adds a few manual changes. Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-24do not pass "git -c foo=bar" params to transport helpersJonathan Nieder
Like $GIT_CONFIG, $GIT_CONFIG_PARAMETERS needs to be suppressed by "git push" and its cousins when running local transport helpers to imitate remote transport well. Noticed-by: Jeff King <peff@peff.net> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-07-29Refuse deleting the current branch via pushJunio C Hamano
This makes git-push refuse deleting the current branch by default. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-07-29Refuse updating the current branch in a non-bare repository via pushJunio C Hamano
This makes git-push refuse pushing into a non-bare repository to update the current branch by default. To help people who are used to be able to do this (and later "reset --hard" it in some other way), an error message is issued when this refusal is triggered, instructing how to resurrect the old behaviour. Hosting sites that do not give the users direct access to customize their repositories (e.g. repo.or.cz, gitorious, github etc.) may further want to explicitly set the configuration variable to "refuse" for their customers' repositories. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-11receive-pack: receive.denyDeleteCurrentJunio C Hamano
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-11Modernize t5400 test scriptJunio C Hamano
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>
2008-12-15Get rid of the last remnants of GIT_CONFIG_LOCALv1.6.1-rc3Johannes Schindelin
In dc871831(Only use GIT_CONFIG in "git config", not other programs), GIT_CONFIG_LOCAL was rested in peace, in favor of not reading /etc/gitconfig and $HOME/.gitconfig at all when GIT_CONFIG is set. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-11-09t5400: expect success for denying deletionJeff King
Commit a240de11 introduced this test and the code to make it successful. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-11-02Introduce receive.denyDeletesJan Krüger
Occasionally, it may be useful to prevent branches from getting deleted from a centralized repository, particularly when no administrative access to the server is available to undo it via reflog. It also makes receive.denyNonFastForwards more useful if it is used for access control since it prevents force-updating by deleting and re-creating a ref. Signed-off-by: Jan Krüger <jk@jk.gs> Acked-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-03tests: use "git xyzzy" form (t3600 - t6999)Nanako Shiraishi
Converts tests between t3600-t6300. Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-24tests: do not use implicit "git diff --no-index"Junio C Hamano
As a general principle, we should not use "git diff" to validate the results of what git command that is being tested has done. We would not know if we are testing the command in question, or locating a bug in the cute hack of "git diff --no-index". Rather use test_cmp for that purpose. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-13grep portability fix: don't use "-e" or "-q"Jeff King
System V versions of grep (such as Solaris /usr/bin/grep) don't understand either of these options. git's usage of "grep -e pattern" fell into one of two categories: 1. equivalent to "grep pattern". -e is only useful here if the pattern begins with a "-", but all of the patterns are hardcoded and do not begin with a dash. 2. stripping comments and blank lines with grep -v -e "^$" -e "^#" We can fortunately do this in the affirmative as grep '^[^#]' Uses of "-q" can be replaced with redirection to /dev/null. In many tests, however, "grep -q" is used as "if this string is in the expected output, we are OK". In this case, it is fine to just remove the "-q" entirely; it simply makes the "verbose" mode of the test slightly more verbose. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-10-20send-pack: respect '+' on wildcard refspecsJeff King
When matching source and destination refs, we were failing to pull the 'force' parameter from wildcard refspecs (but not explicit ones) and attach it to the ref struct. This adds a test for explicit and wildcard refspecs; the latter fails without this patch. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-09-18git-push: documentation and tests for pushing only branchesJeff King
Commit 098e711e caused git-push to match only branches when considering which refs to push. This patch updates the documentation accordingly and adds a test for this behavior. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-03Rewrite "git-frotz" to "git frotz"Junio C Hamano
This uses the remove-dashes target to replace "git-frotz" to "git frotz". Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-07War on whitespaceJunio C Hamano
This uses "git-apply --whitespace=strip" to fix whitespace errors that have crept in to our source files over time. There are a few files that need to have trailing whitespaces (most notably, test vectors). The results still passes the test, and build result in Documentation/ area is unchanged. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-03-11Merge branch 'js/diff-ni'Junio C Hamano
* js/diff-ni: Get rid of the dependency to GNU diff in the tests diff --no-index: support /dev/null as filename diff-ni: fix the diff with standard input diff: support reading a file from stdin via "-"
2007-03-07Refactor handling of error_string in receive-packShawn O. Pearce
I discovered we did not send an ng line in the report-status feedback if the ref was not updated because the repository has the config option receive.denyNonFastForwards enabled. I think the reason this happened is that it is simply too easy to forget to set error_string when returning back a failure from update() We now return an ng line for a non-fastforward update, which in turn will cause send-pack to exit with a non-zero exit status. Hence the modified test. This refactoring changes update to return a const char* describing the error, which execute_commands always loads into error_string. The result is what I think is cleaner code, and allows us to initialize the error_string member to NULL when we read_head_info. I want error_string to be NULL in all commands before we call execute_commands, so that we can reuse the run_hook function to execute a new pre-receive hook. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-04Get rid of the dependency to GNU diff in the testsJohannes Schindelin
Now that "git diff" handles stdin and relative paths outside the working tree correctly, we can convert all instances of "diff -u" to "git diff". This commit is really the result of $ perl -pi.bak -e 's/diff -u/git diff/' $(git grep -l "diff -u" t/) Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net> (cherry picked from commit c699a40d68215c7e44a5b26117a35c8a56fbd387)
2007-01-29[PATCH] Rename git-repo-config to git-config.Tom Prince
Signed-off-by: Tom Prince <tom.prince@ualberta.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-22Revert "prune: --grace=time"Junio C Hamano
This reverts commit 9b088c4e394df84232cfd37aea78349a495b09c1. Protecting 'mature' objects does not make it any safer. We should admit that git-prune is inherently unsafe when run in parallel with other operations without involving unwarranted locking overhead, and with the latest git, even rebase and reset would not immediately create crufts anyway.
2007-01-21prune: --grace=timeMatthias Lederhofer
This option gives grace period to objects that are unreachable from the refs from getting pruned. The default value is 24 hours and may be changed using gc.prunegrace. Signed-off-by: Matthias Lederhofer <matled@gmx.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-29t5400 send-pack test: try a bit more nontrivial transfer.Junio C Hamano
Not that this reveals anything new, but I did test_tick shell function in test-lib and found it rather cute and nice. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-24Allow git push to delete remote ref.Junio C Hamano
This allows you to say git send-pack $URL :refs/heads/$branch to delete the named remote branch. The refspec $src:$dst means replace the destination ref with the object known as $src on the local side, so this is a natural extension to make an empty $src mean "No object" to delete the target. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-21Document receive.denyNonFastforwardsJohannes Schindelin
[jc: with a fix to config handling in t5400 test, which took annoyingly long to diagnose.] Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> 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-10-10t5400-send-pack relies on a working cpioJohannes Schindelin
Since cygwin does not install cpio by default, t5400 results in a very cryptic failure. So, test for cpio explicitely. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-02Add git-symbolic-refJunio C Hamano
This adds the counterpart of git-update-ref that lets you read and create "symbolic refs". By default it uses a symbolic link to represent ".git/HEAD -> refs/heads/master", but it can be compiled to use the textfile symbolic ref. The places that did 'readlink .git/HEAD' and 'ln -s refs/heads/blah .git/HEAD' have been converted to use new git-symbolic-ref command, so that they can deal with either implementation. Signed-off-by: Junio C Hamano <junio@twinsun.com>
2005-09-09'build' scripts before installing.Junio C Hamano
Earlier we renamed git-foo.sh to git-foo while installing, which was mostly done by inertia than anything else. This however made writing tests to use scripts harder. This patch builds the scripts the same way as we build binaries from their sources. As a side effect, you can now specify non-standard paths you have your Perl binary is in when running the make. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-08Big tool rename.Junio C Hamano
As promised, this is the "big tool rename" patch. The primary differences since 0.99.6 are: (1) git-*-script are no more. The commands installed do not have any such suffix so users do not have to remember if something is implemented as a shell script or not. (2) Many command names with 'cache' in them are renamed with 'index' if that is what they mean. There are backward compatibility symblic links so that you and Porcelains can keep using the old names, but the backward compatibility support is expected to be removed in the near future. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-08-12[PATCH] Trapping exit in tests, using return for errorsPavel Roskin
I have noticed that "make test" fails without any explanations when the "merge" utility is missing. I don't think tests should be silent in case of failure. It turned out that the particular test was using "exit" to interrupt the test in case of an error. This caused the whole test script to exit. No further tests would be run even if "--immediate" wasn't specified. No error message was printed. This patch does following: All instances of "exit", "exit 1" and "(exit 1)" in tests have been replaced with "return 1". In fact, "(exit 1)" had no effect. File descriptor 5 is duplicated from file descriptor 1. This is needed to print important error messages from tests. New function test_run_() has been introduced. Any "return" in the test would merely cause that function to return without skipping calls to test_failure_() and test_ok_(). The new function also traps "exit" and treats it like a fatal error (in case somebody reintroduces "exit" in the tests). test_expect_failure() and test_expect_success() check both the result of eval and the return value of test_run_(). If the later is not 0, it's always a failure because it indicates the the test didn't complete. Signed-off-by: Pavel Roskin <proski@gnu.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-08-12[PATCH] Missing test_donePavel Roskin
All test scripts should end with test_done, which reports the test results. In the future, it could be used for other purposes, e.g. to distinguish graceful end from "exit" in a test. This patch fixes scripts that don't call test_done. Signed-off-by: Pavel Roskin <proski@gnu.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-07-27Fix potential send-pack SIGSEGVLinus Torvalds
The check that the source is ahead of the destination incorrectly expects pop_most_recent_commit() to gracefully handle an empty list. Fix by just checking the list itself, rather than the return value of the pop function. [jc: I did the test script that demonstrated the problem] Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>