diff options
| author | Junio C Hamano <junkio@cox.net> | 2007-03-14 01:40:19 -0700 |
|---|---|---|
| committer | Junio C Hamano <junkio@cox.net> | 2007-03-14 01:40:19 -0700 |
| commit | c1f5086e23e97cdb8c913c10ff273e6cff913d52 (patch) | |
| tree | 0e3ee9bae1a93256387d045d18082d182dcaa158 /git-parse-remote.sh | |
| parent | Merge branch 'dz/mailinfo' (diff) | |
| parent | .gitignore: add git-fetch--tool (diff) | |
| download | git-c1f5086e23e97cdb8c913c10ff273e6cff913d52.tar.gz git-c1f5086e23e97cdb8c913c10ff273e6cff913d52.zip | |
Merge branch 'jc/fetch'
* jc/fetch:
.gitignore: add git-fetch--tool
builtin-fetch--tool: fix reflog notes.
git-fetch: retire update-local-ref which is not used anymore.
builtin-fetch--tool: make sure not to overstep ls-remote-result buffer.
fetch--tool: fix uninitialized buffer when reading from stdin
builtin-fetch--tool: adjust to updated sha1_object_info().
git-fetch--tool takes flags before the subcommand.
Use stdin reflist passing in git-fetch.sh
Use stdin reflist passing in parse-remote
Allow fetch--tool to read from stdin
git-fetch: rewrite expand_ref_wildcard in C
git-fetch: rewrite another shell loop in C
git-fetch: move more code into C.
git-fetch--tool: start rewriting parts of git-fetch in C.
git-fetch: split fetch_main into fetch_dumb and fetch_native
Diffstat (limited to 'git-parse-remote.sh')
| -rwxr-xr-x | git-parse-remote.sh | 47 |
1 files changed, 2 insertions, 45 deletions
diff --git a/git-parse-remote.sh b/git-parse-remote.sh index 5208ee6ce0..c46131f6d6 100755 --- a/git-parse-remote.sh +++ b/git-parse-remote.sh @@ -81,51 +81,8 @@ get_remote_default_refs_for_push () { # is to help prevent randomly "globbed" ref from being chosen as # a merge candidate expand_refs_wildcard () { - remote="$1" - shift - first_one=yes - if test "$#" = 0 - then - echo empty - echo >&2 "Nothing specified for fetching with remote.$remote.fetch" - fi - for ref - do - lref=${ref#'+'} - # a non glob pattern is given back as-is. - expr "z$lref" : 'zrefs/.*/\*:refs/.*/\*$' >/dev/null || { - if test -n "$first_one" - then - echo "explicit" - first_one= - fi - echo "$ref" - continue - } - - # glob - if test -n "$first_one" - then - echo "glob" - first_one= - fi - from=`expr "z$lref" : 'z\(refs/.*/\)\*:refs/.*/\*$'` - to=`expr "z$lref" : 'zrefs/.*/\*:\(refs/.*/\)\*$'` - local_force= - test "z$lref" = "z$ref" || local_force='+' - echo "$ls_remote_result" | - sed -e '/\^{}$/d' | - ( - IFS=' ' - while read sha1 name - do - # ignore the ones that do not start with $from - mapped=${name#"$from"} - test "z$name" = "z$mapped" && continue - echo "${local_force}${name}:${to}${mapped}" - done - ) - done + echo "$ls_remote_result" | + git fetch--tool expand-refs-wildcard "-" "$@" } # Subroutine to canonicalize remote:local notation. |
