mirror of
https://github.com/git/git.git
synced 2024-11-30 21:44:02 +08:00
cc395d6b47
The function `unique_tracking_name()` returns an allocated string, but does not clearly indicate this because its return type is `const char *` instead of `char *`. This has led to various callsites where we never free its returned memory at all, which causes memory leaks. Plug those leaks and mark now-passing tests as leak free. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 lines
367 B
C
16 lines
367 B
C
#ifndef CHECKOUT_H
|
|
#define CHECKOUT_H
|
|
|
|
#include "hash-ll.h"
|
|
|
|
/*
|
|
* Check if the branch name uniquely matches a branch name on a remote
|
|
* tracking branch. Return the name of the remote if such a branch
|
|
* exists, NULL otherwise.
|
|
*/
|
|
char *unique_tracking_name(const char *name,
|
|
struct object_id *oid,
|
|
int *dwim_remotes_matched);
|
|
|
|
#endif /* CHECKOUT_H */
|