1. 09 Dec, 2013 2 commits
    • Torsten Bögershausen's avatar
      connect.c: refactor url parsing · c59ab2e5
      Torsten Bögershausen authored
      Make the function is_local() in transport.c public, rename it into
      url_is_local_not_ssh() and use it in both transport.c and connect.c
      
      Use a protocol "local" for URLs for the local file system.
      
      One note about using file:// under Windows:
      
      The (absolute) path on Unix like system typically starts with "/".
      When the host is empty, it can be omitted, so that a shell scriptlet
      url=file://$pwd
      will give a URL like "file:///home/user/repo".
      
      Windows does not have the same concept of a root directory located in "/".
      When parsing the URL allow "file://C:/user/repo"
      (even if RFC1738 indicates that "file:///C:/user/repo" should be used).
      Signed-off-by: default avatarTorsten Bögershausen <tboegi@web.de>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
      c59ab2e5
    • Torsten Bögershausen's avatar
      git fetch-pack: add --diag-url · 5610b7c0
      Torsten Bögershausen authored
      The main purpose is to trace the URL parser called by git_connect() in
      connect.c
      
      The main features of the parser can be listed as this:
      
      - parse out host and path for URLs with a scheme (git:// file:// ssh://)
      - parse host names embedded by [] correctly
      - extract the port number, if present
      - separate URLs like "file" (which are local)
        from URLs like "host:repo" which should use ssh
      
      Add the new parameter "--diag-url" to "git fetch-pack", which prints
      the value for protocol, host and path to stderr and exits.
      Signed-off-by: default avatarTorsten Bögershausen <tboegi@web.de>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
      5610b7c0
  2. 08 Jul, 2013 1 commit
    • Junio C Hamano's avatar
      cache.h: move remote/connect API out of it · 47a59185
      Junio C Hamano authored
      The definition of "struct ref" in "cache.h", a header file so
      central to the system, always confused me.  This structure is not
      about the local ref used by sha1-name API to name local objects.
      
      It is what refspecs are expanded into, after finding out what refs
      the other side has, to define what refs are updated after object
      transfer succeeds to what values.  It belongs to "remote.h" together
      with "struct refspec".
      
      While we are at it, also move the types and functions related to the
      Git transport connection to a new header file connect.h
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
      47a59185