diff options
author | Jay Soffian <jaysoffian@gmail.com> | 2009-02-27 14:10:04 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-02-27 15:08:08 -0800 |
commit | 7b3db095d53d19e08b27114d8706ff3be6693af7 (patch) | |
tree | 60231bbfbede85ab1672129b7ca3f375c982a421 /builtin-clone.c | |
parent | 6cb4e6cc0f5b2de1998492b0178eeb0f99d4a800 (diff) | |
download | git-7b3db095d53d19e08b27114d8706ff3be6693af7.tar.gz git-7b3db095d53d19e08b27114d8706ff3be6693af7.tar.xz |
remote: make copy_ref() perform a deep copy
To ensure that copied refs can always be freed w/o causing a
double-free, make copy_ref() perform a deep copy.
Also have copy_ref() return NULL if asked to copy NULL to simplify
things for the caller.
Background: currently copy_ref() performs a shallow copy. This is fine
for current callers who never free the result and/or only copy refs
which contain NULL pointers. But copy_ref() is about to gain a new
caller (guess_remote_head()) which copies refs where peer_ref is not
NULL and the caller of guess_remote_head() will want to free the result.
Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-clone.c')
0 files changed, 0 insertions, 0 deletions