<commit_before>#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include "cache.h"
#include "commit.h"
#include <errno.h>
#include <stdio.h>
#include "rsh.h"
#include "pull.h"

static int fd_in;
static int fd_out;

int fetch(unsigned char *sha1)
{
	write(fd_out, sha1, 20);
	return write_sha1_from_fd(sha1, fd_in);
}

int main(int argc, char **argv)
{
	char *commit_id;
	char *url;
	int arg = 1;

	while (arg < argc && argv[arg][0] == '-') {
		if (argv[arg][1] == 't') {
			get_tree = 1;
		} else if (argv[arg][1] == 'c') {
			get_history = 1;
		} else if (argv[arg][1] == 'a') {
			get_all = 1;
			get_tree = 1;
			get_history = 1;
		}
		arg++;
	}
	if (argc < arg + 2) {
		usage("rpull [-c] [-t] [-a] commit-id url");
		return 1;
	}
	commit_id = argv[arg];
	url = argv[arg + 1];

	if (setup_connection(&fd_in, &fd_out, "rpush", url, arg, argv + 1))
		return 1;

	if (pull(commit_id))
		return 1;

	return 0;
}<commit_msg>[PATCH] Fix git rpull.<commit_after>#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include "cache.h"
#include "commit.h"
#include <errno.h>
#include <stdio.h>
#include "rsh.h"
#include "pull.h"

static int fd_in;
static int fd_out;

int fetch(unsigned char *sha1)
{
	write(fd_out, sha1, 20);
	return write_sha1_from_fd(sha1, fd_in);
}

int main(int argc, char **argv)
{
	char *commit_id;
	char *url;
	int arg = 1;

	while (arg < argc && argv[arg][0] == '-') {
		if (argv[arg][1] == 't') {
			get_tree = 1;
		} else if (argv[arg][1] == 'c') {
			get_history = 1;
		} else if (argv[arg][1] == 'a') {
			get_all = 1;
			get_tree = 1;
			get_history = 1;
		}
		arg++;
	}
	if (argc < arg + 2) {
		usage("rpull [-c] [-t] [-a] commit-id url");
		return 1;
	}
	commit_id = argv[arg];
	url = argv[arg + 1];

	if (setup_connection(&fd_in, &fd_out, "git-rpush", url, arg, argv + 1))
		return 1;

	if (pull(commit_id))
		return 1;

	return 0;
}
{'fraction_non_alphanumeric': 0.1992696922274387, 'fraction_numerical': 0.023995826812728223, 'mean_word_length': 3.5450236966824646, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '26705', 'n_tokens_mistral': 932, 'n_tokens_neox': 851, 'n_words': 217}