summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d1014a1)
raw | patch | inline | side by side (parent: d1014a1)
author | Junio C Hamano <junkio@cox.net> | |
Mon, 1 Jan 2007 20:24:15 +0000 (12:24 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Mon, 1 Jan 2007 22:36:01 +0000 (14:36 -0800) |
Removal of them is needed regardless of errors. The original
code had the removal outside of the process which sets the flag
to tell the later step what to remove, but it runs as a
downstream of a pipeline and its effect was lost.
Signed-off-by: Junio C Hamano <junkio@cox.net>
code had the removal outside of the process which sets the flag
to tell the later step what to remove, but it runs as a
downstream of a pipeline and its effect was lost.
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-fetch.sh | patch | blob | history |
diff --git a/git-fetch.sh b/git-fetch.sh
index 8bd11f8b60c0ffec8a67f59bc7e12e1f63adfc91..466fe59e35e03a6f9955f78e4238d9e0a60b8dc0 100755 (executable)
--- a/git-fetch.sh
+++ b/git-fetch.sh
;; # we are already done.
*)
( : subshell because we muck with IFS
- pack_lockfile=
IFS=" $LF"
(
- git-fetch-pack --thin $exec $keep $shallow_depth "$remote" $rref || echo failed "$remote"
+ git-fetch-pack --thin $exec $keep $shallow_depth "$remote" $rref ||
+ echo failed "$remote"
) |
- while read sha1 remote_name
- do
+ (
+ trap '
+ if test -n "$keepfile" && test -f "$keepfile"
+ then
+ rm -f "$keepfile"
+ fi
+ ' 0
+
+ keepfile=
+ while read sha1 remote_name
+ do
case "$sha1" in
failed)
echo >&2 "Fetch failure: $remote"
pack)
continue ;;
keep)
- pack_lockfile="$GIT_OBJECT_DIRECTORY/pack/pack-$remote_name.keep"
+ keepfile="$GIT_OBJECT_DIRECTORY/pack/pack-$remote_name.keep"
continue ;;
esac
found=
append_fetch_head "$sha1" "$remote" \
"$remote_name" "$remote_nick" "$local_name" \
"$not_for_merge" || exit
- done &&
- if [ "$pack_lockfile" ]; then rm -f "$pack_lockfile"; fi
+ done
+ )
) || exit ;;
esac