summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d9f3be7)
raw | patch | inline | side by side (parent: d9f3be7)
author | Junio C Hamano <junkio@cox.net> | |
Sat, 20 Aug 2005 10:00:03 +0000 (03:00 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Wed, 24 Aug 2005 23:50:51 +0000 (16:50 -0700) |
Amos Waterland sent in a patch for the pre-multi-head aware
version of "git pull" to do this, but the code changed quite a
bit since then. If there is no argument given to pull from, and
if "origin" makes sense, default to fetch/pull from "origin"
instead of barfing.
[jc: besides, the patch by Amos broke the non-default case where
explicit refspecs are specified, and did not make sure we know
what "origin" means before defaulting to it.]
Signed-off-by: Junio C Hamano <junkio@cox.net>
version of "git pull" to do this, but the code changed quite a
bit since then. If there is no argument given to pull from, and
if "origin" makes sense, default to fetch/pull from "origin"
instead of barfing.
[jc: besides, the patch by Amos broke the non-default case where
explicit refspecs are specified, and did not make sure we know
what "origin" means before defaulting to it.]
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-fetch-script | patch | blob | history |
diff --git a/git-fetch-script b/git-fetch-script
index 9b05e41176454f7d4ad8f13a098954712e88110a..a70909e4ff15035d135eed061de8b4ea70ac5060 100755 (executable)
--- a/git-fetch-script
+++ b/git-fetch-script
append=
case "$#" in
0)
- die "Where do you want to fetch from?" ;;
+ test -f "$GIT_DIR/branches/origin" ||
+ test -f "$GIT_DIR/remotes/origin" ||
+ die "Where do you want to fetch from?"
+ set origin ;;
*)
case "$1" in
-a|--a|--ap|--app|--appe|--appen|--append)