提交 5f906b1c 编写于 作者: J Junio C Hamano

Merge fixes up to 1.2.1

...@@ -419,6 +419,7 @@ $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh ...@@ -419,6 +419,7 @@ $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
rm -f $@ rm -f $@
sed -e '1s|#!.*/sh|#!$(call shq,$(SHELL_PATH))|' \ sed -e '1s|#!.*/sh|#!$(call shq,$(SHELL_PATH))|' \
-e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \ -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
-e 's/@@NO_CURL@@/$(NO_CURL)/g' \
$@.sh >$@ $@.sh >$@
chmod +x $@ chmod +x $@
......
...@@ -22,7 +22,7 @@ while [ "$#" != "0" ]; do ...@@ -22,7 +22,7 @@ while [ "$#" != "0" ]; do
[ -e "$GIT_DIR/refs/heads/$newbranch" ] && [ -e "$GIT_DIR/refs/heads/$newbranch" ] &&
die "git checkout: branch $newbranch already exists" die "git checkout: branch $newbranch already exists"
git-check-ref-format "heads/$newbranch" || git-check-ref-format "heads/$newbranch" ||
die "we do not like '$newbranch' as a branch name." die "git checkout: we do not like '$newbranch' as a branch name."
;; ;;
"-f") "-f")
force=1 force=1
...@@ -75,9 +75,15 @@ done ...@@ -75,9 +75,15 @@ done
if test "$#" -ge 1 if test "$#" -ge 1
then then
hint=
if test "$#" -eq 1
then
hint="
Did you intend to checkout '$@' which can not be resolved as commit?"
fi
if test '' != "$newbranch$force$merge" if test '' != "$newbranch$force$merge"
then then
die "updating paths and switching branches or forcing are incompatible." die "git checkout: updating paths is incompatible with switching branches/forcing$hint"
fi fi
if test '' != "$new" if test '' != "$new"
then then
...@@ -117,7 +123,8 @@ fi ...@@ -117,7 +123,8 @@ fi
[ -z "$branch$newbranch" ] && [ -z "$branch$newbranch" ] &&
[ "$new" != "$old" ] && [ "$new" != "$old" ] &&
die "git checkout: you need to specify a new branch name" die "git checkout: to checkout the requested commit you need to specify
a name for a new branch which is created and switched to"
if [ "$force" ] if [ "$force" ]
then then
...@@ -165,8 +172,10 @@ else ...@@ -165,8 +172,10 @@ else
exit 0 exit 0
) )
saved_err=$? saved_err=$?
test "$new" = "$old" || if test "$saved_err" = 0
git diff-index --name-status "$new" then
test "$new" = "$old" || git diff-index --name-status "$new"
fi
(exit $saved_err) (exit $saved_err)
fi fi
......
...@@ -206,7 +206,13 @@ yes,yes) ...@@ -206,7 +206,13 @@ yes,yes)
fi fi
;; ;;
http://*) http://*)
clone_dumb_http "$repo" "$D" if test -z "@@NO_CURL@@"
then
clone_dumb_http "$repo" "$D"
else
echo >&2 "http transport not supported, rebuild Git with curl support"
exit 1
fi
;; ;;
*) *)
cd "$D" && case "$upload_pack" in cd "$D" && case "$upload_pack" in
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册