From: Junio C Hamano Date: Wed, 25 Jan 2006 08:28:18 +0000 (-0800) Subject: Merge branches 'jc/clone', 'md/env' and 'mo/path' X-Git-Tag: v1.2.0~115 X-Git-Url: https://www.git.lorimer.id.au/gitweb.git/diff_plain/92643a27cc2cc7ce55ba2afd6155f94b40e1aa89?hp=e6489a1bdf6e20371e6cd6497918f1c1198d5f81 Merge branches 'jc/clone', 'md/env' and 'mo/path' --- diff --git a/Documentation/fetch-options.txt b/Documentation/fetch-options.txt index e624d3d0ee..83237562d2 100644 --- a/Documentation/fetch-options.txt +++ b/Documentation/fetch-options.txt @@ -3,6 +3,13 @@ existing contents of `.git/FETCH_HEAD`. Without this option old data in `.git/FETCH_HEAD` will be overwritten. +--upload-pack :: +-u :: + When given, and the repository to fetch from is handled + by 'git-fetch-pack', '--exec=' is passed to + the command to specify non-default path for the command + run on the other end. + -f, \--force:: When `git-fetch` is used with `:` refspec, it refuses to update the local branch diff --git a/connect.c b/connect.c index d6f4e4c3a7..e1c04e1eae 100644 --- a/connect.c +++ b/connect.c @@ -644,10 +644,16 @@ int git_connect(int fd[2], char *url, const char *prog) ssh_basename++; execlp(ssh, ssh_basename, host, command, NULL); } - else + else { + unsetenv(ALTERNATE_DB_ENVIRONMENT); + unsetenv(DB_ENVIRONMENT); + unsetenv(GIT_DIR_ENVIRONMENT); + unsetenv(GRAFT_ENVIRONMENT); + unsetenv(INDEX_ENVIRONMENT); execlp("sh", "sh", "-c", command, NULL); + } die("exec failed"); - } + } fd[0] = pipefd[0][0]; fd[1] = pipefd[1][1]; close(pipefd[0][1]); diff --git a/git-fetch.sh b/git-fetch.sh index 4a0cb32f30..6730346ba0 100755 --- a/git-fetch.sh +++ b/git-fetch.sh @@ -17,12 +17,20 @@ append= force= verbose= update_head_ok= +exec= +upload_pack= while case "$#" in 0) break ;; esac do case "$1" in -a|--a|--ap|--app|--appe|--appen|--append) append=t ;; + -u|--u|--up|--upl|--uploa|--upload|--upload-|--upload-p|--upload-pa|\ + --upload-pac|--upload-pack) + shift + exec="--exec=$1" + upload_pack="-u $1" + ;; -f|--f|--fo|--for|--forc|--force) force=t ;; @@ -196,7 +204,7 @@ reflist=$(get_remote_refs_for_fetch "$@") if test "$tags" then taglist=$(IFS=" " && - git-ls-remote --tags "$remote" | + git-ls-remote $upload_pack --tags "$remote" | while read sha1 name do case "$name" in @@ -312,7 +320,7 @@ fetch_main () { ( : subshell because we muck with IFS IFS=" $LF" ( - git-fetch-pack $keep "$remote" $rref || echo failed "$remote" + git-fetch-pack $exec $keep "$remote" $rref || echo failed "$remote" ) | while read sha1 remote_name do @@ -361,7 +369,7 @@ fetch_main "$reflist" case "$no_tags$tags" in '') taglist=$(IFS=" " && - git-ls-remote --tags "$remote" | + git-ls-remote $upload_pack --tags "$remote" | sed -ne 's|^\([0-9a-f]*\)[ ]\(refs/tags/.*\)^{}$|\1 \2|p' | while read sha1 name do diff --git a/git-ls-remote.sh b/git-ls-remote.sh index f69926862f..2c9a588d21 100755 --- a/git-ls-remote.sh +++ b/git-ls-remote.sh @@ -2,7 +2,8 @@ # usage () { - echo >&2 "usage: $0 [--heads] [--tags] ..." + echo >&2 "usage: $0 [--heads] [--tags] [-u|--upload-pack ]" + echo >&2 " ..." exit 1; } @@ -11,6 +12,7 @@ die () { exit 1 } +exec= while case "$#" in 0) break;; esac do case "$1" in @@ -18,6 +20,11 @@ do heads=heads; shift ;; -t|--t|--ta|--tag|--tags) tags=tags; shift ;; + -u|--u|--up|--upl|--uploa|--upload|--upload-|--upload-p|--upload-pa|\ + --upload-pac|--upload-pack) + shift + exec="--exec=$1" + shift;; --) shift; break ;; -*) @@ -66,7 +73,7 @@ rsync://* ) ;; * ) - git-peek-remote "$peek_repo" || + git-peek-remote $exec "$peek_repo" || echo "failed slurping" ;; esac |