#include "pkt-line.h"
#include "quote.h"
#include "refs.h"
-#include <sys/wait.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <signal.h>
static char *server_capabilities;
line[--len] = 0;
if (!strcmp(line, "NAK"))
return 0;
- if (!strncmp(line, "ACK ", 4)) {
+ if (!prefixcmp(line, "ACK ")) {
if (!get_sha1_hex(line+4, result_sha1)) {
if (strstr(line+45, "continue"))
return 2;
*/
if (namelen != patlen &&
patlen != namelen - 5 &&
- strncmp(name, "refs/heads/", 11) &&
- strncmp(name, "refs/tags/", 10)) {
+ prefixcmp(name, "refs/heads/") &&
+ prefixcmp(name, "refs/tags/")) {
/* We want to catch the case where only weak
* matches are found and there are multiple
* matches, and where more than one strong
int sockfd = git_tcp_connect_sock(host);
fd[0] = sockfd;
- fd[1] = sockfd;
+ fd[1] = dup(sockfd);
}