summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5ca8078)
raw | patch | inline | side by side (parent: 5ca8078)
author | Junio C Hamano <junkio@cox.net> | |
Tue, 31 Oct 2006 00:02:07 +0000 (16:02 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Tue, 31 Oct 2006 00:02:07 +0000 (16:02 -0800) |
This reverts commit c7740a943ec896247ebc5514b6be02710caf3c53. There should
be a way to make this controllable from the receiver end.
be a way to make this controllable from the receiver end.
receive-pack.c | patch | blob | history | |
send-pack.c | patch | blob | history | |
sha1_file.c | patch | blob | history | |
t/t5400-send-pack.sh | patch | blob | history |
diff --git a/receive-pack.c b/receive-pack.c
index ef50226f4d6bf462e5346e8d75234ce1dc7c2a62..ea2dbd4e3398ca90823dcd453cbb52c5dcea135c 100644 (file)
--- a/receive-pack.c
+++ b/receive-pack.c
static const char receive_pack_usage[] = "git-receive-pack <git-dir>";
static const char *unpacker[] = { "unpack-objects", NULL };
-static const char *keep_packer[] = {
- "index-pack", "--stdin", "--fix-thin", NULL
-};
static int report_status;
-static int keep_pack;
-static char capabilities[] = "report-status keep-pack";
+static char capabilities[] = "report-status";
static int capabilities_sent;
static int show_ref(const char *path, const unsigned char *sha1)
if (reflen + 82 < len) {
if (strstr(refname + reflen + 1, "report-status"))
report_status = 1;
- if (strstr(refname + reflen + 1, "keep-pack"))
- keep_pack = 1;
}
cmd = xmalloc(sizeof(struct command) + len - 80);
hashcpy(cmd->old_sha1, old_sha1);
static const char *unpack(int *error_code)
{
- int code;
-
- if (keep_pack)
- code = run_command_v_opt(ARRAY_SIZE(keep_packer) - 1,
- keep_packer, RUN_GIT_CMD);
- else
- code = run_command_v_opt(ARRAY_SIZE(unpacker) - 1,
- unpacker, RUN_GIT_CMD);
+ int code = run_command_v_opt(1, unpacker, RUN_GIT_CMD);
*error_code = 0;
switch (code) {
if (!dir)
usage(receive_pack_usage);
- if (!enter_repo(dir, 0))
+ if(!enter_repo(dir, 0))
die("'%s': unable to chdir or not a git archive", dir);
write_head_info();
diff --git a/send-pack.c b/send-pack.c
index 54d218c03b68d0b5bf1c2304b7b5bee2d0bd98a6..5bb123a37696384c5413dac128529d1c1f679940 100644 (file)
--- a/send-pack.c
+++ b/send-pack.c
#include "exec_cmd.h"
static const char send_pack_usage[] =
-"git-send-pack [--all] [--keep] [--exec=git-receive-pack] <remote> [<head>...]\n"
+"git-send-pack [--all] [--exec=git-receive-pack] <remote> [<head>...]\n"
" --all and explicit <head> specification are mutually exclusive.";
static const char *exec = "git-receive-pack";
static int verbose;
static int send_all;
static int force_update;
static int use_thin_pack;
-static int keep_pack;
static int is_zero_sha1(const unsigned char *sha1)
{
int new_refs;
int ret = 0;
int ask_for_status_report = 0;
- int ask_to_keep_pack = 0;
int expect_status_report = 0;
/* No funny business with the matcher */
/* Does the other end support the reporting? */
if (server_supports("report-status"))
ask_for_status_report = 1;
- if (server_supports("keep-pack") && keep_pack)
- ask_to_keep_pack = 1;
/* match them up */
if (!remote_tail)
strcpy(old_hex, sha1_to_hex(ref->old_sha1));
new_hex = sha1_to_hex(ref->new_sha1);
- if (ask_for_status_report || ask_to_keep_pack) {
- packet_write(out, "%s %s %s%c%s%s",
+ if (ask_for_status_report) {
+ packet_write(out, "%s %s %s%c%s",
old_hex, new_hex, ref->name, 0,
- ask_for_status_report
- ? " report-status" : "",
- ask_to_keep_pack
- ? " keep-pack" : "");
- if (ask_for_status_report)
- expect_status_report = 1;
+ "report-status");
ask_for_status_report = 0;
- ask_to_keep_pack = 0;
+ expect_status_report = 1;
}
else
packet_write(out, "%s %s %s",
verbose = 1;
continue;
}
- if (!strcmp(arg, "--keep")) {
- keep_pack = 1;
- continue;
- }
if (!strcmp(arg, "--thin")) {
use_thin_pack = 1;
continue;
diff --git a/sha1_file.c b/sha1_file.c
index 278ba2f4cd05727f89be58a91a3d4efb7ac839a3..e89d24c01595aa8ea6c6306928639b40f3313a50 100644 (file)
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -1292,7 +1292,7 @@ static void *read_packed_sha1(const unsigned char *sha1, char *type, unsigned lo
return unpack_entry(&e, type, size);
}
-void *read_sha1_file(const unsigned char *sha1, char *type, unsigned long *size)
+void * read_sha1_file(const unsigned char *sha1, char *type, unsigned long *size)
{
unsigned long mapsize;
void *map, *buf;
if (find_pack_entry(sha1, &e, NULL))
return 1;
- if (find_sha1_file(sha1, &st))
- return 1;
- reprepare_packed_git();
- return find_pack_entry(sha1, &e, NULL);
+ return find_sha1_file(sha1, &st) ? 1 : 0;
}
/*
diff --git a/t/t5400-send-pack.sh b/t/t5400-send-pack.sh
index d831f8dfe3e2ebd5f6753ed82588ab03d3d990bd..8afb89971752fe4a91b9b7c62b4b0a6b69a8272b 100755 (executable)
--- a/t/t5400-send-pack.sh
+++ b/t/t5400-send-pack.sh
! diff -u .git/refs/heads/master victim/.git/refs/heads/master
'
-test_expect_success 'push with --keep' '
- t=`cd victim && git-rev-parse --verify refs/heads/master` &&
- git-update-ref refs/heads/master $t &&
- : > foo &&
- git add foo &&
- git commit -m "one more" &&
- git-send-pack --keep ./victim/.git/ master
-'
-
test_done