summaryrefslogtreecommitdiff
path: root/t
AgeCommit message (Collapse)AuthorFilesLines
2013-04-22Merge branch 'js/rerere-forget-protect-against-NUL' into maintLibravatar Junio C Hamano1-0/+25
* js/rerere-forget-protect-against-NUL: rerere forget: do not segfault if not all stages are present rerere forget: grok files containing NUL
2013-04-22Merge branch 'jc/apply-ws-fix-tab-in-indent' into maintLibravatar Junio C Hamano3-1/+31
* jc/apply-ws-fix-tab-in-indent: test: resurrect q_to_tab apply --whitespace=fix: avoid running over the postimage buffer
2013-04-22Merge branch 'ap/combine-diff-ignore-whitespace' into maintLibravatar Junio C Hamano1-0/+111
* ap/combine-diff-ignore-whitespace: Allow combined diff to ignore white-spaces
2013-04-22Merge branch 'tr/perl-keep-stderr-open' into maintLibravatar Junio C Hamano1-1/+2
* tr/perl-keep-stderr-open: t9700: do not close STDERR perl: redirect stderr to /dev/null instead of closing
2013-04-22Merge branch 'lf/bundle-with-tip-wo-message' into maintLibravatar Junio C Hamano1-0/+10
* lf/bundle-with-tip-wo-message: bundle: Accept prerequisites without commit messages
2013-04-22Merge branch 'jk/filter-branch-come-back-to-original' into maintLibravatar Junio C Hamano1-0/+14
* jk/filter-branch-come-back-to-original: filter-branch: return to original dir after filtering
2013-04-12Merge branch 'rr/test-3200-style' into maintLibravatar Junio C Hamano1-253/+267
* rr/test-3200-style: t3200 (branch): modernize style Conflicts: t/t3200-branch.sh
2013-04-12Merge branch 'jc/t5516-pushInsteadOf-vs-pushURL' into maintLibravatar Junio C Hamano1-3/+3
* jc/t5516-pushInsteadOf-vs-pushURL: t5516: test interaction between pushURL and pushInsteadOf correctly
2013-04-12Correct common spelling mistakes in comments and testsLibravatar Stefano Lattarini8-12/+12
Most of these were found using Lucas De Marchi's codespell tool. Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Acked-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-11t: make PIPE a standard test prerequisiteLibravatar Adam Spiers4-16/+10
The 'PIPE' test prerequisite was already defined identically by t9010 and t9300, therefore it makes sense to make it a predefined prerequisite. Signed-off-by: Adam Spiers <git@adamspiers.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-09t/README: --immediate skips cleanup commands for failed testsLibravatar Simon Ruderich1-1/+4
Signed-off-by: Simon Ruderich <simon@ruderich.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-07bundle: Accept prerequisites without commit messagesLibravatar Lukas Fleischer1-0/+10
While explicitly stating that the commit message in a prerequisite line is optional, we required all lines with 40 or more characters to contain a space after the object name, bailing out if a line consisted of an object name only. This was to allow bundling a history to a commit without an message, but the code forgot that it already called rtrim() to remove that whitespace. As a workaround, only check for SP when the line has more than 40 characters. Signed-off-by: Lukas Fleischer <git@cryptocrack.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-07Sync with 1.8.1.6Libravatar Junio C Hamano1-0/+27
2013-04-07Merge branch 'jc/directory-attrs-regression-fix' into maint-1.8.1Libravatar Junio C Hamano1-0/+27
A pattern "dir" (without trailing slash) in the attributes file stopped matching a directory "dir" by mistake with an earlier change that wanted to allow pattern "dir/" to also match. * jc/directory-attrs-regression-fix: t: check that a pattern without trailing slash matches a directory dir.c::match_pathname(): pay attention to the length of string parameters dir.c::match_pathname(): adjust patternlen when shifting pattern dir.c::match_basename(): pay attention to the length of string parameters attr.c::path_matches(): special case paths that end with a slash attr.c::path_matches(): the basename is part of the pathname
2013-04-04t9700: do not close STDERRLibravatar Thomas Rast1-1/+2
Much like the previous patch, this triggered an unrelated bug. Closing STDERR is not worth it anyway, as we risk writing die() and such to random files that happen to be subsequently opened on FD 2. Don't do it. Signed-off-by: Thomas Rast <trast@inf.ethz.ch> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-04Merge branch 'jk/peel-ref' into maintLibravatar Junio C Hamano1-0/+9
* jk/peel-ref: upload-pack: load non-tip "want" objects from disk upload-pack: make sure "want" objects are parsed upload-pack: drop lookup-before-parse optimization
2013-04-04rerere forget: do not segfault if not all stages are presentLibravatar Johannes Sixt1-0/+13
The loop that fills in the buffers that are later passed to the merge driver exits early when not all stages of a path are present in the index. But since the buffer pointers are not initialized in advance, the subsequent accesses are undefined. Initialize buffer pointers in advance to avoid undefined behavior later. That is not sufficient, though, to get correct operation of handle_cache(). The function replays a conflicted merge to extract the part inside the conflict markers. As written, the loop exits early when a stage is missing. Consequently, the buffers for later stages that would be present in the index are not filled in and the merge is replayed with incomplete data. Fix it by investigating all stages of the given path. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-03Merge branch 'bc/commit-complete-lines-given-via-m-option' into maintLibravatar Junio C Hamano1-4/+12
'git commit -m "$msg"' used to add an extra newline even when $msg already ended with one. * bc/commit-complete-lines-given-via-m-option: Documentation/git-commit.txt: rework the --cleanup section git-commit: only append a newline to -m mesg if necessary t7502: demonstrate breakage with a commit message with trailing newlines t/t7502: compare entire commit message with what was expected
2013-04-03Merge branch 'jk/alias-in-bare' into maintLibravatar Junio C Hamano1-0/+19
An aliased command spawned from a bare repository that does not say it is bare with "core.bare = yes" is treated as non-bare by mistake. * jk/alias-in-bare: setup: suppress implicit "." work-tree for bare repos environment: add GIT_PREFIX to local_repo_env cache.h: drop LOCAL_REPO_ENV_SIZE
2013-04-03Merge branch 'ks/rfc2047-one-char-at-a-time' into maintLibravatar Junio C Hamano1-13/+14
When "format-patch" quoted a non-ascii strings on the header files, it incorrectly applied rfc2047 and chopped a single character in the middle of it. * ks/rfc2047-one-char-at-a-time: format-patch: RFC 2047 says multi-octet character may not be split
2013-04-03Merge branch 'jk/empty-archive' into maintLibravatar Junio C Hamano5-12/+108
"git archive" reports a failure when asked to create an archive out of an empty tree. It would be more intuitive to give an empty archive back in such a case. * jk/empty-archive: archive: handle commits with an empty tree test-lib: factor out $GIT_UNZIP setup
2013-04-03Merge branch 'ph/tag-force-no-warn-on-creation' into maintLibravatar Junio C Hamano1-0/+12
"git tag -f <tag>" always said "Updated tag '<tag>'" even when creating a new tag (i.e. not overwriting nor updating). * ph/tag-force-no-warn-on-creation: tag: --force does not have to warn when creating tags
2013-04-03Sync with 1.8.1 maintenance trackLibravatar Junio C Hamano4-73/+193
* maint-1.8.1: Start preparing for 1.8.1.6 git-tag(1): we tag HEAD by default Fix revision walk for commits with the same dates t2003: work around path mangling issue on Windows pack-refs: add fully-peeled trait pack-refs: write peeled entry for non-tags use parse_object_or_die instead of die("bad object") avoid segfaults on parse_object failure entry: fix filter lookup t2003: modernize style name-hash.c: fix endless loop with core.ignorecase=true
2013-04-03Merge branch 'kb/name-hash' into maint-1.8.1Libravatar Junio C Hamano1-0/+20
* kb/name-hash: name-hash.c: fix endless loop with core.ignorecase=true
2013-04-03Merge branch 'kk/revwalk-slop-too-many-commit-within-a-second' into maint-1.8.1Libravatar Junio C Hamano1-0/+13
* kk/revwalk-slop-too-many-commit-within-a-second: Fix revision walk for commits with the same dates
2013-04-03Merge branch 'jk/checkout-attribute-lookup' into maint-1.8.1Libravatar Junio C Hamano1-73/+96
* jk/checkout-attribute-lookup: t2003: work around path mangling issue on Windows entry: fix filter lookup t2003: modernize style
2013-04-03Merge branch 'jk/fully-peeled-packed-ref' into maint-1.8.1Libravatar Junio C Hamano1-0/+64
* jk/fully-peeled-packed-ref: pack-refs: add fully-peeled trait pack-refs: write peeled entry for non-tags use parse_object_or_die instead of die("bad object") avoid segfaults on parse_object failure
2013-04-03Merge branch 'ap/maint-diff-rename-avoid-overlap' into maint-1.8.1Libravatar Junio C Hamano1-0/+54
* ap/maint-diff-rename-avoid-overlap: tests: make sure rename pretty print works diff: prevent pprint_rename from underrunning input diff: Fix rename pretty-print when suffix and prefix overlap
2013-04-02filter-branch: return to original dir after filteringLibravatar Jeff King1-0/+14
The first thing filter-branch does is to create a temporary directory, either ".git-rewrite" in the current directory (which may be the working tree or the repository if bare), or in a directory specified by "-d". We then chdir to $tempdir/t as our temporary working directory in which to run tree filters. After finishing the filter, we then attempt to go back to the original directory with "cd ../..". This works in the .git-rewrite case, but if "-d" is used, we end up in a random directory. The only thing we do after this chdir is to run git-read-tree, but that means that: 1. The working directory is not updated to reflect the filtered history. 2. We dump random files into "$tempdir/.." (e.g., if you use "-d /tmp/foo", we dump junk into /tmp). Fix it by recording the full path to the original directory and returning there explicitly. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-02rerere forget: grok files containing NULLibravatar Johannes Sixt1-0/+12
Using 'git rerere forget .' after a merge that involved binary files runs into an infinite loop if the binary file contains a zero byte. Replace a strchrnul by memchr because the former does not make progress as soon as the NUL is encountered. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-01Merge branch 'ap/maint-diff-rename-avoid-overlap' into maintLibravatar Junio C Hamano1-0/+54
* ap/maint-diff-rename-avoid-overlap: tests: make sure rename pretty print works diff: prevent pprint_rename from underrunning input diff: Fix rename pretty-print when suffix and prefix overlap
2013-04-01Merge branch 'rr/tests-dedup-test-config' into maintLibravatar Junio C Hamano2-10/+0
* rr/tests-dedup-test-config: t4018,7810,7811: remove test_config() redefinition
2013-04-01Merge branch 'tb/document-status-u-tradeoff' into maintLibravatar Junio C Hamano3-0/+3
* tb/document-status-u-tradeoff: status: advise to consider use of -u when read_directory takes too long git status: document trade-offs in choosing parameters to the -u option
2013-04-01Merge branch 'da/downcase-u-in-usage' into maintLibravatar Junio C Hamano2-2/+2
* da/downcase-u-in-usage: contrib/mw-to-git/t/install-wiki.sh: use a lowercase "usage:" string contrib/examples/git-remote.perl: use a lowercase "usage:" string tests: use a lowercase "usage:" string git-svn: use a lowercase "usage:" string Documentation/user-manual.txt: use a lowercase "usage:" string templates/hooks--update.sample: use a lowercase "usage:" string contrib/hooks/setgitperms.perl: use a lowercase "usage:" string contrib/examples: use a lowercase "usage:" string contrib/fast-import/import-zips.py: use spaces instead of tabs contrib/fast-import/import-zips.py: fix broken error message contrib/fast-import: use a lowercase "usage:" string contrib/credential: use a lowercase "usage:" string git-cvsimport: use a lowercase "usage:" string git-cvsimport: use a lowercase "usage:" string git-cvsexportcommit: use a lowercase "usage:" string git-archimport: use a lowercase "usage:" string git-merge-one-file: use a lowercase "usage:" string git-relink: use a lowercase "usage:" string git-svn: use a lowercase "usage:" string git-sh-setup: use a lowercase "usage:" string
2013-03-29test: resurrect q_to_tabLibravatar Junio C Hamano1-0/+4
New test may want to use this helper; keep it for them that do not need to protect literal SP. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-28t: check that a pattern without trailing slash matches a directoryLibravatar Jeff King1-0/+27
Prior to v1.8.1.1, with: git init echo content >foo && mkdir subdir && echo content >subdir/bar && echo "subdir export-ignore" >.gitattributes git add . && git commit -m one && git archive HEAD | tar tf - the resulting archive would contain only "foo" and ".gitattributes", not subdir. This was broken with a recent change that intended to allow "subdir/ export-ignore" to also exclude the directory, but instead ended up _requiring_ the trailing slash by mistake. A pattern "subdir" should match any path "subdir", whether it is a directory or a non-directory. A pattern "subdir/" insists that a path "subdir" must be a directory for it to match. This patch adds test not just for this simple case, but also for deeper cross-directory cases, as well as cases with wildcards. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-28t5516: test interaction between pushURL and pushInsteadOf correctlyLibravatar Junio C Hamano1-3/+3
1c2eafb89bca (Add url.<base>.pushInsteadOf: URL rewriting for push only, 2009-09-07) wants to make sure that a push destination read from URL is not rewritten by pushInsteadOf because an explicit pushURL exists; for that, a pushInsteadOf rewrite rule for the value of remote.r.URL is set to a non-existent is set up. We would also want to make sure that pushInsteadOf rewrite rule is not applied to the location read from pushURL. This way, we will make sure that - "testrepo/" (pushURL) gets updated; - the push does not try to update "trash2/" (the result of applying pushInsteadOf to pushURL); - the push does not try to update "trash3/" (the result of applying pushInsteadOf to URL). Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-26Merge branch 'we/submodule-update-prefix-output' into maintLibravatar Junio C Hamano1-1/+2
"git submodule update", when recursed into sub-submodules, did not acccumulate the prefix paths. * we/submodule-update-prefix-output: submodule update: when using recursion, show full path
2013-03-26Merge branch 'rs/zip-compresssed-size-with-export-subst' into maintLibravatar Junio C Hamano1-0/+6
When export-subst is used, "zip" output recorded incorrect size of the file. * rs/zip-compresssed-size-with-export-subst: archive-zip: fix compressed size for stored export-subst files
2013-03-26Merge branch 'nd/branch-error-cases' into maintLibravatar Junio C Hamano1-0/+21
"git branch" had more cases where it did not bother to check nonsense command line parameters. * nd/branch-error-cases: branch: segfault fixes and validation
2013-03-22Fix revision walk for commits with the same datesLibravatar Kacper Kornet1-0/+13
Logic in still_interesting function allows to stop the commits traversing if the oldest processed commit is not older then the youngest commit on the list to process and the list contains only commits marked as not interesting ones. It can be premature when dealing with a set of coequal commits. For example git rev-list A^! --not B provides wrong answer if all commits in the range A..B had the same commit time and there are more then 7 of them. To fix this problem the relevant part of the logic in still_interesting is changed to: the walk can be stopped if the oldest processed commit is younger then the youngest commit on the list to processed. Signed-off-by: Kacper Kornet <draenog@pld-linux.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-22apply --whitespace=fix: avoid running over the postimage bufferLibravatar Junio C Hamano3-3/+29
Originally update-pre-post-images could assume that any whitespace fixing will make the result only shorter by unexpanding runs of leading SPs into HTs and removing trailing whitespaces at the end of lines. Updating the post-image we read from the patch to match the actual result can be performed in-place under this assumption. These days, however, we have tab-in-indent (aka Python) rule whose result can be longer than the original, and we do need to allocate a larger buffer than the input and replace the result. Fortunately the support for lengthening rewrite was already added when we began supporting "match while ignoring whitespace differences" mode in 86c91f91794c (git apply: option to ignore whitespace differences, 2009-08-04). We only need to correctly count the number of bytes necessary to hold the updated result and tell the function to allocate a new buffer. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-20t3200 (branch): modernize styleLibravatar Ramkumar Ramachandra1-233/+244
Style is inconsistent throughout the file. Make the following changes: 1. Indent everything with tabs. 2. Put the opening quote (') for the test in the same line as test_expect_success, and the closing quote on a line by itself. 3. Do not add extra space between redirection operator and filename, i.e. "cmd >dst", not "cmd > dst". Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-20t2003: work around path mangling issue on WindowsLibravatar Johannes Sixt1-2/+2
MSYS bash considers the part "/g" in the sed expression "s/./=/g" as an absolute path after an assignment, and mangles it to a C:/something string. Do not attract bash's attention by avoiding the equals sign. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-19t4018,7810,7811: remove test_config() redefinitionLibravatar Ramkumar Ramachandra3-15/+0
test_config() is already a well-defined function in test-lib-functions.sh. Don't duplicate it unnecessarily. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-18pack-refs: add fully-peeled traitLibravatar Michael Haggerty1-0/+22
Older versions of pack-refs did not write peel lines for refs outside of refs/tags. This meant that on reading the pack-refs file, we might set the REF_KNOWS_PEELED flag for such a ref, even though we do not know anything about its peeled value. The previous commit updated the writer to always peel, no matter what the ref is. That means that packed-refs files written by newer versions of git are fine to be read by both old and new versions of git. However, we still have the problem of reading packed-refs files written by older versions of git, or by other implementations which have not yet learned the same trick. The simplest fix would be to always unset the REF_KNOWS_PEELED flag for refs outside of refs/tags that do not have a peel line (if it has a peel line, we know it is valid, but we cannot assume a missing peel line means anything). But that loses an important optimization, as upload-pack should not need to load the object pointed to by refs/heads/foo to determine that it is not a tag. Instead, we add a "fully-peeled" trait to the packed-refs file. If it is set, we know that we can trust a missing peel line to mean that a ref cannot be peeled. Otherwise, we fall back to assuming nothing. [commit message and tests by Jeff King <peff@peff.net>] Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-17Merge branch 'maint'Libravatar Junio C Hamano1-0/+4
* maint: t1507: Test that branchname@{upstream} is interpreted as branch
2013-03-17t1507: Test that branchname@{upstream} is interpreted as branchLibravatar Kacper Kornet1-0/+4
Syntax branchname@{upstream} should interpret its argument as a name of a branch. Add the test to check that it doesn't try to interpret it as a refname if the branch in question does not exist. Signed-off-by: Kacper Kornet <draenog@pld-linux.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-17pack-refs: write peeled entry for non-tagsLibravatar Jeff King1-0/+42
When we pack an annotated tag ref, we write not only the sha1 of the tag object along with the ref, but also the sha1 obtained by peeling the tag. This lets readers of the pack-refs file know the peeled value without having to actually load the object, speeding up upload-pack's ref advertisement. The writer marks a packed-refs file with peeled refs using the "peeled" trait at the top of the file. When the reader sees this trait, it knows that each ref is either followed by its peeled value, or it is not an annotated tag. However, there is a mismatch between the assumptions of the reader and writer. The writer will only peel refs under refs/tags, but the reader does not know this; it will assume a ref without a peeled value must not be a tag object. Thus an annotated tag object placed outside of the refs/tags hierarchy will not have its peeled value printed by upload-pack. The simplest way to fix this is to start writing peel values for all refs. This matches what the reader expects for both new and old versions of git. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-16upload-pack: make sure "want" objects are parsedLibravatar Jeff King1-0/+9
When upload-pack receives a "want" line from the client, it adds it to an object array. We call lookup_object to find the actual object, which will only check for objects already in memory. This works because we are expecting to find objects that we already loaded during the ref advertisement. We use the resulting object structs for a variety of purposes. Some of them care only about the object flags, but others care about the type of the object (e.g., ok_to_give_up), or even feed them to the revision parser (when --depth is used), which assumes that objects it receives are fully parsed. Once upon a time, this was OK; any object we loaded into memory would also have been parsed. But since 435c833 (upload-pack: use peel_ref for ref advertisements, 2012-10-04), we try to avoid parsing objects during the ref advertisement. This means that lookup_object may return an object with a type of OBJ_NONE. The resulting mess depends on the exact set of objects, but can include the revision parser barfing, or the shallow code sending the wrong set of objects. This patch teaches upload-pack to parse each "want" object as we receive it. We do not replace the lookup_object call with parse_object, as the current code is careful not to let just any object appear on a "want" line, but rather only one we have previously advertised (whereas parse_object would actually load any arbitrary object from disk). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>