Refuse to create funny refs in clone-pack, git-fetch and receive-pack.
Using git-check-ref-format, make sure we do not create refs with funny names when cloning from elsewhere (clone-pack), fast forwarding local heads (git-fetch), or somebody pushes into us (receive-pack). Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
@ -94,6 +94,12 @@ canon_refs_list_for_fetch () {
|
||||
heads/* | tags/* ) local="refs/$local" ;;
|
||||
*) local="refs/heads/$local" ;;
|
||||
esac
|
||||
|
||||
if local_ref_name=$(expr "$local" : 'refs/\(.*\)')
|
||||
then
|
||||
git-check-ref-format "$local_ref_name" ||
|
||||
die "* refusing to create funny ref '$local_ref_name' locally"
|
||||
fi
|
||||
echo "${dot_prefix}${force}${remote}:${local}"
|
||||
dot_prefix=.
|
||||
done
|
||||
|
Reference in New Issue
Block a user