aboutsummaryrefslogtreecommitdiff
path: root/t
Commit message (Collapse)AuthorAge
* Merge early part of git-svn into maintJunio C Hamano2010-10-05
|\ | | | | | | | | | | | | * commit 'git-svn/master~1': git-svn: fix processing of decorated commit hashes git-svn: check_cherry_pick should exclude commits already in our history Documentation/git-svn: discourage "noMetadata"
| * git-svn: check_cherry_pick should exclude commits already in our historySteven Walter2010-09-24
| | | | | | | | | | | | | | | | | | | | | | | | | | The merge-base between @$parents and $merge_tip may have been reached through a merge commit. This means that some commits that are ancestors of @$parents will not be ancestors of $merge_base. The mergeinfo property will not list commits that are ancestors of @$parents, so we need to explicitly exclude them. [ew: squashed and cleaned up test case from Steven] Signed-off-by: Steven Walter <stevenrwalter@gmail.com> Acked-by: Eric Wong <normalperson@yhbt.net>
* | t3020 (ls-files-error-unmatch): remove stray '1' from end of fileElijah Newren2010-10-03
| | | | | | | | | | | | | | Acked-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | t0004 (unwritable files): simplify error handlingJonathan Nieder2010-09-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of ... normal test script ... status=$? ... cleanup ... (exit $status) set up cleanup commands with test_when_finished. This makes the test script a little shorter, and more importantly, it ensures errors during cleanup are reported. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | stash: fix git stash branch regression when branch creation failsJon Seymour2010-09-29
| | | | | | | | | | | | | | | | | | "git stash branch <branch> <stash>" started discarding the stash when the branch creation fails. It should have kept the stash intact when aborting. Signed-off-by: Jon Seymour <jon.seymour@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | stash drops the stash even if creating the branch fails because it already ↵Tomas Carnecky2010-09-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | exists This bug was disovered by someone on IRC when he tried to $ git stash branch <branch> <stash> while <branch> already existed. In that case the stash is dropped even though it isn't applied on any branch, so the stash is effectively lost. Signed-off-by: Tomas Carnecky <tom@dbservice.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | t6050 (replace): fix bogus "fetch branch with replacement" testChristian Couder2010-09-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test was missing some "&&" at the end of some lines and it was wrong because, as the replacement refs were not fetched, the commits from the parallel branch should not show up. This was found by Elijah Newren. This is fixed by checking that after the branch from HASH6 is fetched, the commits from the parallel branch don't show up, and then by fetching the replacement refs and checking that they do show up afterwards. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | prefer test -h over test -L in shell scriptsJeff King2010-09-27
| | | | | | | | | | | | | | | | Even though "-L" is POSIX, the former is more portable, and we tend to prefer it already. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | t1503: Fix arithmetic expansion syntax error when using dashRamsay Jones2010-09-27
| | | | | | | | | | | | | | | | | | | | | | | | | | On systems which have dash as /bin/sh, such as Ubuntu, the final test (master@{n} for various n) fails with a syntax error while processing an arithmetic expansion. The syntax error is caused by using a bare name ('N') as a variable reference in the expression. In order to avoid the syntax error, we spell the variable reference as '$N' rather than simply 'N'. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-stash: fix flag parsingBrian Gernhardt2010-09-26
| | | | | | | | | | | | | | | | | | | | Currently git-stash uses `git rev-parse --no-revs -- "$@"` to set its FLAGS variable. This is the same as `FLAGS="-- $@"`. It should use `git rev-parse --no-revs --flags "$@"`, but that eats any "-q" or "--quiet" argument. So move the check for quiet before rev-parse. Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | t/t3903-stash: improve testing of git-stash showBrandon Casey2010-09-26
|/ | | | | | | | | | | | | Recently, the 'stash show' functionality was broken for the case when a stash-like argument was supplied. Since, commit 9bf09e, 'stash show' when supplied a stash-like argument prints nothing and still exists with a zero status. Unfortunately, the flaw slipped through the test suite cracks since the output of 'stash show' was not verified to be correct. Improve and expand on the existing tests so that this flaws is detected. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* t/t7300: workaround ancient touch by rearranging argumentsBrandon Casey2010-09-17
| | | | | | | | | | | | The ancient touch on Solaris 7 thinks that a decimal number supplied as the first argument specifies a date_time to give to the files specified by the remaining arguments. In this case, it fails to parse '1' as a proper date_time and exits with a failure status. Workaround this flaw by rearranging the arguments supplied to touch so that a non-digit appears first and touch will not be confused. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'bg/fix-t7003'Junio C Hamano2010-09-16
|\ | | | | | | | | * bg/fix-t7003: t7003: Use test_commit instead of custom function
| * t7003: Use test_commit instead of custom functionBrian Gernhardt2010-09-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | t7003-filter-branch.sh had a make_commit() function that was identical to test_commit() in test-lib.sh except that it used tr to create a lowercase file name from the uppercase branch name instead of appending ".t". Not only is this unneeded code duplication, it also was something simply waiting to fail on case-insensitive file systems. So replace all uses of make_commit with test_commit. While we're editing the setup, chain it together with && so that failures early in the sequence don't get lost and add a commit graph. Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'dr/maint-ls-tree-prefix-recursion-fix'Junio C Hamano2010-09-15
|\ \ | | | | | | | | | | | | * dr/maint-ls-tree-prefix-recursion-fix: ls-tree $di $dir: do not mistakenly recurse into directories
| * | ls-tree $di $dir: do not mistakenly recurse into directoriesJunio C Hamano2010-09-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | When applying two pathspecs, one of which is named as a prefix to the other, we mistakenly recursed into the shorter one. Noticed and fixed by David Reis. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'jl/fix-test'Junio C Hamano2010-09-15
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jl/fix-test: t1020: Get rid of 'cd "$HERE"' at the start of each test t2016 (checkout -p): add missing && t1302 (core.repositoryversion): style tweaks t2105 (gitfile): add missing && t1450 (fsck): remove dangling objects tests: subshell indentation stylefix Several tests: cd inside subshell instead of around
| * | | t1020: Get rid of 'cd "$HERE"' at the start of each testJens Lehmann2010-09-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To achieve that, all cd commands which weren't inside a subshell had to be put into a new one. Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | t2016 (checkout -p): add missing &&Jonathan Nieder2010-09-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Although the set_state command is not likely to fail, it is best to stay in the habit of checking for failures. Cc: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | t1302 (core.repositoryversion): style tweaksJonathan Nieder2010-09-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This test is from 2007, which is late enough for the style to be recognizably modern but still a while ago. Freshen it up to follow new best practices: - guard setup commands with test_expect_setup, so errors at that stage can be caught; - use <<\EOF in preference to <<EOF, to save reviewers the trouble of looking for variable interpolations; - use test_cmp instead of test "$foo" = "$bar", for better output with -v on failure; - indent commands in subshells and let them span multiple lines; - combine the two "gitdir required mode" tests that do not make as much sense alone. Cc: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | t2105 (gitfile): add missing &&Jonathan Nieder2010-09-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make sure early failures are not masked by later successes. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Acked-by: Brad King <brad.king@kitware.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | t1450 (fsck): remove dangling objectsJonathan Nieder2010-09-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fsck test is generally careful to remove the corrupt objects it inserts, but dangling objects are left behind due to some typos and omissions. It is better to clean up more completely, to simplify the addition of later tests. So: - guard setup and cleanup with test_expect_success to catch typos and errors; - check both stdout and stderr when checking for empty fsck output; - use test_cmp empty file in place of test $(wc -l <file) = 0, for better debugging output when running tests with -v; - add a remove_object () helper and use it to replace broken object removal code that forgot about the fanout in .git/objects; - disable gc.auto, to avoid tripping up object removal if the number of objects ever reaches that threshold. - use test_when_finished to ensure cleanup tasks are run and succeed when tests fail; - add a new final test that no breakage or dangling objects was left behind. While at it, add a brief description to test_description of the history that is expected to persist between tests. Part of a campaign to clean up subshell usage in tests. Cc: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | tests: subshell indentation stylefixJonathan Nieder2010-09-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Format the subshells introduced by the previous patch (Several tests: cd inside subshell instead of around, 2010-09-06) like so: ( cd subdir && ... ) && This is generally easier to read and has the nice side-effect that this patch will show what commands are used in the subshell, making it easier to check for lost environment variables and similar behavior changes. Cc: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | Merge branch 'jl/maint-fix-test'Junio C Hamano2010-09-06
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jl/maint-fix-test: Several tests: cd inside subshell instead of around Conflicts: t/t9600-cvsimport.sh
| | * | | Several tests: cd inside subshell instead of aroundJens Lehmann2010-09-06
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed all places where it was a straightforward change from cd'ing into a directory and back via "cd .." to a cd inside a subshell. Found these places with "git grep -w "cd \.\.". Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'ch/filter-branch-deprecate-remap-to-ancestor'Junio C Hamano2010-09-15
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | * ch/filter-branch-deprecate-remap-to-ancestor: filter-branch: retire --remap-to-ancestor
| * | | | filter-branch: retire --remap-to-ancestorCsaba Henk2010-08-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We can be clever and know by ourselves when we need the behavior implied by "--remap-to-ancestor". No need to encumber users by having them exposed to it as a tunable. (Option kept for backward compatibility, but it's now a no-op.) Signed-off-by: Csaba Henk <csaba@gluster.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | Merge branch 'ch/maint-cannot-create-bundle-error'Junio C Hamano2010-09-15
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | * ch/maint-cannot-create-bundle-error: bundle: detect if bundle file cannot be created
| * | | | | bundle: detect if bundle file cannot be createdCsaba Henk2010-08-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bundle command silently died with no sign of failure if it could not create the bundle file. (Eg.: its path resovles to a directory, or the parent dir is sticky while file already exists and is owned by someone else.) Signed-off-by: Csaba Henk <csaba@gluster.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | Merge branch 'ks/recursive-rename-add-identical'Junio C Hamano2010-09-15
|\ \ \ \ \ \ | |_|_|_|_|/ |/| | | | | | | | | | | | | | | | | * ks/recursive-rename-add-identical: RE: [PATCH] Avoid rename/add conflict when contents are identical
| * | | | | RE: [PATCH] Avoid rename/add conflict when contents are identicalSchalk, Ken2010-09-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >Due to this this (and maybe all the tests) need to depend on the >SYMLINKS prereq. Here's a third attempt with no use of symlinks in the test: Skip the entire rename/add conflict case if the file added on the other branch has the same contents as the file being renamed. This avoids giving the user an extra copy of the same file and presenting a conflict that is confusing and pointless. A simple test of this case has been added in t/t3030-merge-recursive.sh. Signed-off-by: Ken Schalk <ken.schalk@intel.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | Merge branch 'maint'Junio C Hamano2010-09-12
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * maint: t3101: modernise style compat/nedmalloc: don't force NDEBUG on the rest of git Conflicts: Makefile
| * | | | | | t3101: modernise styleJunio C Hamano2010-09-12
| | |_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | Also add a few " &&" cascade that were missing. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | t/t4018: avoid two unnecessary sub-shell invocationsBrandon Casey2010-09-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | t/t4018: test whether the word_regex patterns compileBrandon Casey2010-09-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously (e3bf5e43), a test was added to test whether the builtin xfuncname regular expressions could be compiled without error by regcomp. Let's do the same for the word_regex patterns. This should help catch any cross-platform incompatibilities that exist between the pattern creator's system and the various platforms that the test suite is commonly run on. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | t/t5510-fetch.sh: improve testing with explicit URL and merge specBrandon Casey2010-09-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 6106ce46 introduced a test to demonstrate fetch's failure to retrieve any objects or update FETCH_HEAD when it was supplied a repository URL and the current branch had a configured merge spec. This commit expands the original test based on comments from Junio Hamano. In addition to actually verifying that the fetch updates FETCH_HEAD correctly, and does not update the current branch, two more tests are added to ensure that the merge configuration is ignored even when the supplied URL matches the URL of the remote configured for the branch. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | t/t7008: workaround broken handling of \000 by printf on IRIXBrandon Casey2010-09-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On IRIX 6.5, the printf utility in /usr/bin does not appear to handle the \ddd notation according to POSIX. This printf appears to halt processing of the string argument and ignore any additional characters in the string. Work around this flaw by replacing the \000's with 'Q' and using the q_to_nul helper function provided by test-lib.sh This problem with printf is not apparent when using the Bash shell since Bash implements a POSIX compatible printf function internally. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | Merge branch 'jk/test-must-fail-missing'Junio C Hamano2010-09-08
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jk/test-must-fail-missing: tests: make test_might_fail fail on missing commands tests: make test_might_fail more verbose tests: make test_must_fail fail on missing commands tests: make test_must_fail more verbose
| * | | | | | tests: make test_might_fail fail on missing commandsJonathan Nieder2010-08-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Detect and report hard-to-notice spelling mistakes like test_might_fail "git config --unset whatever" (the extra quotes prevent the shell from running git as intended; instead, the shell looks for a "git config --unset whatever" file). Cc: Jeff King <peff@peff.net> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | tests: make test_might_fail more verboseJonathan Nieder2010-08-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let test_might_fail say something about its failures for consistency with test_must_fail. Cc: Jeff King <peff@peff.net> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | tests: make test_must_fail fail on missing commandsJeff King2010-08-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The point of it is to run a command that produces failure. A missing command is more likely an error in the test script (e.g., using 'test_must_fail "command with arguments"', or relying on a missing command). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | tests: make test_must_fail more verboseJeff King2010-08-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because test_must_fail fails when a command succeeds, the command frequently does not produce any output (since, after all, it thought it was succeeding). So let's have test_must_fail itself report that a problem occurred. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | Merge branch 'jh/error-removing-missing-note'Junio C Hamano2010-09-08
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jh/error-removing-missing-note: notes: Don't create (empty) commit when removing non-existing notes
| * | | | | | | notes: Don't create (empty) commit when removing non-existing notesJohan Herland2010-08-31
| |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extend remove_note() in the notes API to return whether or not a note was actually removed. Use this in 'git notes remove' to skip the creation of a notes commit when no notes were actually removed. Also add a test illustrating the change in behavior. Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | Merge branch 'bc/maint-fetch-url-only'Junio C Hamano2010-09-08
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bc/maint-fetch-url-only: builtin/fetch.c: ignore merge config when not fetching from branch's remote t/t5510: demonstrate failure to fetch when current branch has merge ref
| * | | | | | | builtin/fetch.c: ignore merge config when not fetching from branch's remoteBrandon Casey2010-08-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When 'git fetch' is supplied a single argument, it tries to match it against a configured remote and then fetch the refs specified by the named remote's fetchspec. Additionally, or alternatively, if the current branch has a merge ref configured, and if the name of the remote supplied to fetch matches the one in the branch's configuration, then git also adds the merge ref to the list of refs to update. If the argument to fetch does not specify a named remote, or if the name supplied does not match the remote configured for the current branch, then the current branch's merge configuration should not be considered. git currently mishandles the case when the argument to fetch specifies a GIT URL(i.e. not a named remote) and the current branch has a configured merge ref. In this case, fetch should ignore the branch's merge ref and attempt to fetch from the remote repository's HEAD branch. But, since fetch only checks _whether_ the current branch has a merge ref configured, and does _not_ check whether the branch's configured remote matches the command line argument (until later), it will mistakenly enter the wrong branch of an 'if' statement and will not fall back to fetch the HEAD branch. The fetch ends up doing nothing and returns with a successful zero status. Fix this by comparing the remote repository's name to the branch's remote name, in addition to whether it has a configured merge ref, sooner, so that fetch can correctly decide whether the branch's configuration is interesting or not, and fall back to fetching from the remote's HEAD branch when appropriate. This fixes the test in t5510. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | t/t5510: demonstrate failure to fetch when current branch has merge refBrandon Casey2010-08-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When 'git fetch' is supplied just a repository URL (not a remote name), and without a fetch refspec, it should fetch from the remote HEAD branch and update FETCH_HEAD with the fetched ref. Currently, when 'git fetch' is called like this, it fails to retrieve anything, and does not update FETCH_HEAD, if the current checked-out branch has a configured merge ref. i.e. this fetch fails to retrieve anything nor update FETCH_HEAD: git checkout master git config branch.master.merge refs/heads/master git fetch git://git.kernel.org/pub/scm/git/git.git but this one does: git config --unset branch.master.merge git fetch git://git.kernel.org/pub/scm/git/git.git Add a test to demonstrate this flaw. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | Merge branch 'jk/maint-pass-c-config-in-env'Junio C Hamano2010-09-08
|\ \ \ \ \ \ \ \ | |_|_|_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jk/maint-pass-c-config-in-env: do not pass "git -c foo=bar" params to transport helpers pass "git -c foo=bar" params through environment
| * | | | | | | do not pass "git -c foo=bar" params to transport helpersJonathan Nieder2010-08-24
| | |_|_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | | | | | t3404 & t7508: cd inside subshell instead of aroundJens Lehmann2010-09-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed all places where it was a straightforward change from cd'ing into a directory and back via "cd .." to a cd inside a subshell. Found these places with "git grep -w "cd \.\.". Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>