1. 02 3月, 2012 1 次提交
  2. 16 10月, 2011 2 次提交
  3. 08 10月, 2011 1 次提交
  4. 10 11月, 2010 1 次提交
  5. 10 9月, 2010 2 次提交
    • B
      t/t5510-fetch.sh: improve testing with explicit URL and merge spec · 042cca38
      Brandon Casey 提交于
      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: NBrandon Casey <casey@nrlssc.navy.mil>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      042cca38
    • J
      tests: subshell indentation stylefix · 18a82692
      Jonathan Nieder 提交于
      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: NJonathan Nieder <jrnieder@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      18a82692
  6. 07 9月, 2010 1 次提交
  7. 26 8月, 2010 2 次提交
    • B
      builtin/fetch.c: ignore merge config when not fetching from branch's remote · 3ee1757b
      Brandon Casey 提交于
      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: NBrandon Casey <casey@nrlssc.navy.mil>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      3ee1757b
    • B
      t/t5510: demonstrate failure to fetch when current branch has merge ref · 6106ce46
      Brandon Casey 提交于
      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: NBrandon Casey <casey@nrlssc.navy.mil>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      6106ce46
  8. 01 6月, 2010 1 次提交
  9. 26 2月, 2010 1 次提交
  10. 15 11月, 2009 1 次提交
  11. 08 8月, 2009 1 次提交
  12. 11 3月, 2009 1 次提交
  13. 14 10月, 2008 1 次提交
    • J
      Fix fetch/pull when run without --update-head-ok · 8ee5d731
      Johannes Schindelin 提交于
      Some confusing tutorials suggested that it would be a good idea to fetch
      into the current branch with something like this:
      
      	git fetch origin master:master
      
      (or even worse: the same command line with "pull" instead of "fetch").
      While it might make sense to store what you want to pull, it typically is
      plain wrong when the current branch is "master".  This should only be
      allowed when (an incorrect) "git pull origin master:master" tries to work
      around by giving --update-head-ok to underlying "git fetch", and otherwise
      we should refuse it, but somewhere along the lines we lost that behavior.
      
      The check for the current branch is now _only_ performed in non-bare
      repositories, which is an improvement from the original behaviour.
      
      Some newer tests were depending on the broken behaviour of "git fetch"
      this patch fixes, and have been adjusted.
      Signed-off-by: NJohannes Schindelin <johannes.schindelin@gmx.de>
      Acked-by: NShawn O. Pearce <spearce@spearce.org>
      Acked-by: NDaniel Barkalow <barkalow@iabervon.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      8ee5d731
  14. 22 9月, 2008 1 次提交
  15. 04 9月, 2008 1 次提交
  16. 14 7月, 2008 1 次提交
  17. 19 6月, 2008 1 次提交
    • J
      clean up error conventions of remote.c:match_explicit · 9a7bbd1d
      Jeff King 提交于
      match_explicit is called for each push refspec to try to
      fully resolve the source and destination sides of the
      refspec.  Currently, we look at each refspec and report
      errors on both the source and the dest side before aborting.
      
      It makes sense to report errors for each refspec, since an
      error in one is independent of an error in the other.
      However, reporting errors on the 'dst' side of a refspec if
      there has been an error on the 'src' side does not
      necessarily make sense, since the interpretation of the
      'dst' side depends on the 'src' side (for example, when
      creating a new unqualified remote ref, we use the same type
      as the src ref).
      
      This patch lets match_explicit return early when the src
      side of the refspec is bogus. We still look at all of the
      refspecs before aborting the push, though.
      
      At the same time, we clean up the call signature, which
      previously took an extra "errs" flag. This was pointless, as
      we didn't act on that flag, but rather just passed it back
      to the caller. Instead, we now use the more traditional
      "return -1" to signal an error, and the caller aggregates
      the error count.
      
      This change fixes two bugs, as well:
      
        - the early return avoids a segfault when passing a NULL
          matched_src to guess_ref()
      
        - the check for multiple sources pointing to a single dest
          aborted if the "err" flag was set. Presumably the intent
          was not to bother with the check if we had no
          matched_src. However, since the err flag was passed in
          from the caller, we might abort the check just because a
          previous refspec had a problem, which doesn't make
          sense.
      
          In practice, this didn't matter, since due to the error
          flag we end up aborting the push anyway.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      9a7bbd1d
  18. 13 3月, 2008 1 次提交
    • J
      add test_cmp function for test scripts · 82ebb0b6
      Jeff King 提交于
      Many scripts compare actual and expected output using
      "diff -u". This is nicer than "cmp" because the output shows
      how the two differ. However, not all versions of diff
      understand -u, leading to unnecessary test failure.
      
      This adds a test_cmp function to the test scripts and
      switches all "diff -u" invocations to use it. The function
      uses the contents of "$GIT_TEST_CMP" to compare its
      arguments; the default is "diff -u".
      
      On systems with a less-capable diff, you can do:
      
        GIT_TEST_CMP=cmp make test
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      82ebb0b6
  19. 02 2月, 2008 1 次提交
    • J
      Sane use of test_expect_failure · 41ac414e
      Junio C Hamano 提交于
      Originally, test_expect_failure was designed to be the opposite
      of test_expect_success, but this was a bad decision.  Most tests
      run a series of commands that leads to the single command that
      needs to be tested, like this:
      
          test_expect_{success,failure} 'test title' '
      	setup1 &&
              setup2 &&
              setup3 &&
              what is to be tested
          '
      
      And expecting a failure exit from the whole sequence misses the
      point of writing tests.  Your setup$N that are supposed to
      succeed may have failed without even reaching what you are
      trying to test.  The only valid use of test_expect_failure is to
      check a trivial single command that is expected to fail, which
      is a minority in tests of Porcelain-ish commands.
      
      This large-ish patch rewrites all uses of test_expect_failure to
      use test_expect_success and rewrites the condition of what is
      tested, like this:
      
          test_expect_success 'test title' '
      	setup1 &&
              setup2 &&
              setup3 &&
              ! this command should fail
          '
      
      test_expect_failure is redefined to serve as a reminder that
      that test *should* succeed but due to a known breakage in git it
      currently does not pass.  So if git-foo command should create a
      file 'bar' but you discovered a bug that it doesn't, you can
      write a test like this:
      
          test_expect_failure 'git-foo should create bar' '
              rm -f bar &&
              git foo &&
              test -f bar
          '
      
      This construct acts similar to test_expect_success, but instead
      of reporting "ok/FAIL" like test_expect_success does, the
      outcome is reported as "FIXED/still broken".
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      41ac414e
  20. 05 12月, 2007 1 次提交
  21. 23 11月, 2007 1 次提交
    • J
      bundle create: keep symbolic refs' names instead of resolving them · c5546e88
      Johannes Schindelin 提交于
      When creating a bundle, symbolic refs used to be resolved to the
      non-symbolic refs they point to before being written to the list
      of contained refs.  I.e. "git bundle create a1.bundle HEAD master"
      would show something like
      
      388afe7881b33102fada216dd07806728773c011        refs/heads/master
      388afe7881b33102fada216dd07806728773c011        refs/heads/master
      
      instead of
      
      388afe7881b33102fada216dd07806728773c011        HEAD
      388afe7881b33102fada216dd07806728773c011        refs/heads/master
      
      Introduce a special handling so that the symbolic refs are listed
      with the names passed on the command line.
      
      Noticed by Santi Béjar.
      Signed-off-by: NJohannes Schindelin <johannes.schindelin@gmx.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      c5546e88
  22. 19 11月, 2007 1 次提交
    • S
      refactor fetch's ref matching to use refname_match() · 605b4978
      Steffen Prohaska 提交于
      The old rules used by fetch were coded as a series of ifs.  The old
      rules are:
      1) match full refname if it starts with "refs/" or matches "HEAD"
      2) verify that full refname starts with "refs/"
      3) match abbreviated name in "refs/" if it starts with "heads/",
          "tags/", or "remotes/".
      4) match abbreviated name in "refs/heads/"
      
      This is replaced by the new rules
      a) match full refname
      b) match abbreviated name prefixed with "refs/"
      c) match abbreviated name prefixed with "refs/heads/"
      
      The details of the new rules are different from the old rules.  We no
      longer verify that the full refname starts with "refs/".  The new rule
      (a) matches any full string.  The old rules (1) and (2) were stricter.
      Now, the caller is responsible for using sensible full refnames.  This
      should be the case for the current code.  The new rule (b) is less
      strict than old rule (3).  The new rule accepts abbreviated names that
      start with a non-standard prefix below "refs/".
      
      Despite this modifications the new rules should handle all cases as
      expected.  Two tests are added to verify that fetch does not resolve
      short tags or HEAD in remotes.
      
      We may even think about loosening the rules a bit more and unify them
      with the rev-parse rules.  This would be done by replacing
      ref_ref_fetch_rules with ref_ref_parse_rules.  Note, the two new test
      would break.
      Signed-off-by: NSteffen Prohaska <prohaska@zib.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      605b4978
  23. 05 11月, 2007 1 次提交
  24. 16 10月, 2007 2 次提交
  25. 01 10月, 2007 1 次提交
  26. 11 8月, 2007 1 次提交
    • J
      allow git-bundle to create bottomless bundle · 7fa8254f
      Junio C Hamano 提交于
      While "git bundle" was a useful way to sneakernet incremental
      changes, we did not allow:
      
      	$ git bundle create v2.6.20.bndl v2.6.20
      
      to create a bundle that contains the whole history to a
      well-known good revision.  Such a bundle can be mirrored
      everywhere, and people can prime their repository with it to
      reduce the load on the repository that serves near the tip of
      the development.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      7fa8254f
  27. 13 3月, 2007 1 次提交
  28. 08 3月, 2007 1 次提交
  29. 07 3月, 2007 1 次提交
  30. 23 2月, 2007 1 次提交
    • J
      Add git-bundle: move objects and references by archive · 2e0afafe
      Johannes Schindelin 提交于
      Some workflows require use of repositories on machines that cannot be
      connected, preventing use of git-fetch / git-push to transport objects and
      references between the repositories.
      
      git-bundle provides an alternate transport mechanism, effectively allowing
      git-fetch and git-pull to operate using sneakernet transport. `git-bundle
      create` allows the user to create a bundle containing one or more branches
      or tags, but with specified basis assumed to exist on the target
      repository. At the receiving end, git-bundle acts like git-fetch-pack,
      allowing the user to invoke git-fetch or git-pull using the bundle file as
      the URL. git-fetch and git-ls-remote determine they have a bundle URL by
      checking that the URL points to a file, but are otherwise unchanged in
      operation with bundles.
      
      The original patch was done by Mark Levedahl <mdl123@verizon.net>.
      
      It was updated to make git-bundle a builtin, and get rid of the tar
      format: now, the first line is supposed to say "# v2 git bundle", the next
      lines either contain a prerequisite ("-" followed by the hash of the
      needed commit), or a ref (the hash of a commit, followed by the name of
      the ref), and finally the pack. As a result, the bundle argument can be
      "-" now.
      Signed-off-by: NJohannes Schindelin <johannes.schindelin@gmx.de>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      2e0afafe
  31. 29 1月, 2007 1 次提交
  32. 13 1月, 2007 1 次提交
  33. 19 12月, 2006 3 次提交
  34. 20 11月, 2006 1 次提交