projects
/
git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Avoid wasting memory while keeping track of what we have during fetch.
[git.git]
/
git-fetch.sh
diff --git
a/git-fetch.sh
b/git-fetch.sh
index
4928cd5
..
2273944
100755
(executable)
--- a/
git-fetch.sh
+++ b/
git-fetch.sh
@@
-94,6
+94,7
@@
append_fetch_head () {
}
fast_forward_local () {
}
fast_forward_local () {
+ mkdir -p "$(dirname "$GIT_DIR/$1")"
case "$1" in
refs/tags/*)
# Tags need not be pointing at commits so there
case "$1" in
refs/tags/*)
# Tags need not be pointing at commits so there
@@
-204,9
+205,16
@@
case "$remote" in
http://* | https://* | rsync://* )
;; # we are already done.
*)
http://* | https://* | rsync://* )
;; # we are already done.
*)
- git-fetch-pack "$remote" $rref |
+ (
+ git-fetch-pack "$remote" $rref || echo failed "$remote"
+ ) |
while read sha1 remote_name
do
while read sha1 remote_name
do
+ case "$sha1" in
+ failed)
+ echo >&2 "Fetch failure: $remote"
+ exit 1 ;;
+ esac
found=
single_force=
for ref in $refs
found=
single_force=
for ref in $refs
@@
-224,7
+232,7
@@
http://* | https://* | rsync://* )
local_name=$(expr "$found" : '[^:]*:\(.*\)')
append_fetch_head "$sha1" "$remote" "$remote_name" "$remote_nick" "$local_name"
local_name=$(expr "$found" : '[^:]*:\(.*\)')
append_fetch_head "$sha1" "$remote" "$remote_name" "$remote_nick" "$local_name"
- done
+ done
|| exit
;;
esac
;;
esac