🌐 AI搜索 & 代理 主页
blob: 1c5cf80f8786eb20c6092a8fbce48e1f1c1cb9e1 [file] [log] [blame]
Linus Torvalds51cb06c2005-07-08 21:24:251#!/bin/sh
freku045@student.liu.se806f36d2005-12-13 22:30:312
3USAGE='[--all] [--force] <repository> [<refspec>...]'
Junio C Hamanoae2b0f12005-11-24 08:12:114. git-sh-setup
Junio C Hamano46b1c7c2005-08-08 05:55:455
6# Parse out parameters and then stop at remote, so that we can
7# translate it using .git/branches information
8has_all=
9has_force=
10has_exec=
11remote=
12
13while case "$#" in 0) break ;; esac
14do
15 case "$1" in
16 --all)
17 has_all=--all ;;
18 --force)
19 has_force=--force ;;
20 --exec=*)
21 has_exec="$1" ;;
22 -*)
c.shoemaker@cox.netc4851042005-10-29 04:16:3323 usage ;;
Junio C Hamano46b1c7c2005-08-08 05:55:4524 *)
Junio C Hamano46b1c7c2005-08-08 05:55:4525 set x "$@"
26 shift
27 break ;;
28 esac
29 shift
30done
Junio C Hamano9a9cbb62005-08-26 17:37:1731case "$#" in
320)
c.shoemaker@cox.netf9362de2005-10-29 04:17:1733 echo "Where would you want to push today?"
34 usage ;;
Junio C Hamano9a9cbb62005-08-26 17:37:1735esac
Junio C Hamano46b1c7c2005-08-08 05:55:4536
Junio C Hamano215a7ad2005-09-08 00:26:2337. git-parse-remote
Junio C Hamanoac4b0cf2005-08-20 09:52:2438remote=$(get_remote_url "$@")
39case "$has_all" in
40--all) set x ;;
41'') set x $(get_remote_refs_for_push "$@") ;;
Junio C Hamano46b1c7c2005-08-08 05:55:4542esac
Junio C Hamanoac4b0cf2005-08-20 09:52:2443shift
Junio C Hamano46b1c7c2005-08-08 05:55:4544
45case "$remote" in
Nick Hengevelddf8171c2005-11-02 19:19:3146git://*)
c.shoemaker@cox.netc4851042005-10-29 04:16:3347 die "Cannot use READ-ONLY transport to push to $remote" ;;
48rsync://*)
49 die "Pushing with rsync transport is deprecated" ;;
Junio C Hamano46b1c7c2005-08-08 05:55:4550esac
51
52set x "$remote" "$@"; shift
53test "$has_all" && set x "$has_all" "$@" && shift
54test "$has_force" && set x "$has_force" "$@" && shift
55test "$has_exec" && set x "$has_exec" "$@" && shift
56
Nick Hengevelddf8171c2005-11-02 19:19:3157case "$remote" in
58http://* | https://*)
59 exec git-http-push "$@";;
60*)
61 exec git-send-pack "$@";;
62esac