aboutsummaryrefslogtreecommitdiff
path: root/receive-pack.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-10-24 21:59:50 -0700
committerJunio C Hamano <gitster@pobox.com>2007-10-24 21:59:50 -0700
commitd90a7fda355c251b8ffdd79617fb083c18245ec2 (patch)
treedff9bc9d8e22b14c73cac403e65997a746aa03b2 /receive-pack.c
parent2db9b49c6c19d3edaa3c20147f7d9f29588433df (diff)
parentca5bb5d5390e4ec709ca3e11c451c58a836d4ee6 (diff)
downloadgit-d90a7fda355c251b8ffdd79617fb083c18245ec2.tar.gz
git-d90a7fda355c251b8ffdd79617fb083c18245ec2.tar.xz
Merge branch 'db/fetch-pack'
* db/fetch-pack: (60 commits) Define compat version of mkdtemp for systems lacking it Avoid scary errors about tagged trees/blobs during git-fetch fetch: if not fetching from default remote, ignore default merge Support 'push --dry-run' for http transport Support 'push --dry-run' for rsync transport Fix 'push --all branch...' error handling Fix compilation when NO_CURL is defined Added a test for fetching remote tags when there is not tags. Fix a crash in ls-remote when refspec expands into nothing Remove duplicate ref matches in fetch Restore default verbosity for http fetches. fetch/push: readd rsync support Introduce remove_dir_recursively() bundle transport: fix an alloc_ref() call Allow abbreviations in the first refspec to be merged Prevent send-pack from segfaulting when a branch doesn't match Cleanup unnecessary break in remote.c Cleanup style nit of 'x == NULL' in remote.c Fix memory leaks when disconnecting transport instances Ensure builtin-fetch honors {fetch,transfer}.unpackLimit ...
Diffstat (limited to 'receive-pack.c')
-rw-r--r--receive-pack.c24
1 files changed, 2 insertions, 22 deletions
diff --git a/receive-pack.c b/receive-pack.c
index 1521d0b2d..38e35c06b 100644
--- a/receive-pack.c
+++ b/receive-pack.c
@@ -382,9 +382,8 @@ static const char *unpack(void)
}
} else {
const char *keeper[6];
- int s, len, status;
+ int s, status;
char keep_arg[256];
- char packname[46];
struct child_process ip;
s = sprintf(keep_arg, "--keep=receive-pack %i on ", getpid());
@@ -403,26 +402,7 @@ static const char *unpack(void)
ip.git_cmd = 1;
if (start_command(&ip))
return "index-pack fork failed";
-
- /*
- * The first thing we expects from index-pack's output
- * is "pack\t%40s\n" or "keep\t%40s\n" (46 bytes) where
- * %40s is the newly created pack SHA1 name. In the "keep"
- * case, we need it to remove the corresponding .keep file
- * later on. If we don't get that then tough luck with it.
- */
- for (len = 0;
- len < 46 && (s = xread(ip.out, packname+len, 46-len)) > 0;
- len += s);
- if (len == 46 && packname[45] == '\n' &&
- memcmp(packname, "keep\t", 5) == 0) {
- char path[PATH_MAX];
- packname[45] = 0;
- snprintf(path, sizeof(path), "%s/pack/pack-%s.keep",
- get_object_directory(), packname + 5);
- pack_lockfile = xstrdup(path);
- }
-
+ pack_lockfile = index_pack_lockfile(ip.out);
status = finish_command(&ip);
if (!status) {
reprepare_packed_git();