diff --git a/cache.h b/cache.h index bf468e5235..724aad41ba 100644 --- a/cache.h +++ b/cache.h @@ -865,6 +865,7 @@ extern struct ref *find_ref_by_name(const struct ref *list, const char *name); #define CONNECT_VERBOSE (1u << 0) extern struct child_process *git_connect(int fd[2], const char *url, const char *prog, int flags); extern int finish_connect(struct child_process *conn); +extern int git_connection_is_socket(struct child_process *conn); extern int path_match(const char *path, int nr, char **match); struct extra_have_objects { int nr, alloc; diff --git a/connect.c b/connect.c index 5884f6d0b2..9b31af02ba 100644 --- a/connect.c +++ b/connect.c @@ -633,10 +633,15 @@ struct child_process *git_connect(int fd[2], const char *url_orig, return conn; } +int git_connection_is_socket(struct child_process *conn) +{ + return conn == &no_fork; +} + int finish_connect(struct child_process *conn) { int code; - if (!conn || conn == &no_fork) + if (!conn || git_connection_is_socket(conn)) return 0; code = finish_command(conn);