diff options
author | Junio C Hamano <junkio@cox.net> | 2005-10-13 18:57:39 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2005-10-15 11:23:39 -0700 |
commit | d8a1deecc6ef37728b951eaba051deb7e0a38af8 (patch) | |
tree | 46880218861d52fb0c30d520030a70cd32bca163 /git-parse-remote.sh | |
parent | git-check-ref-format: reject funny ref names. (diff) | |
download | tgif-d8a1deecc6ef37728b951eaba051deb7e0a38af8.tar.xz |
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>
Diffstat (limited to 'git-parse-remote.sh')
-rwxr-xr-x | git-parse-remote.sh | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/git-parse-remote.sh b/git-parse-remote.sh index 5e75e15a7e..aea7b0e549 100755 --- a/git-parse-remote.sh +++ b/git-parse-remote.sh @@ -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 |