projects
/
git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH] Find size of SHA1 object without inflating everything.
[git.git]
/
http-pull.c
diff --git
a/http-pull.c
b/http-pull.c
index
f693aba
..
551663e
100644
(file)
--- a/
http-pull.c
+++ b/
http-pull.c
@@
-1,11
+1,5
@@
-#include <fcntl.h>
-#include <unistd.h>
-#include <string.h>
-#include <stdlib.h>
#include "cache.h"
#include "commit.h"
#include "cache.h"
#include "commit.h"
-#include <errno.h>
-#include <stdio.h>
#include "pull.h"
#include "pull.h"
@@
-24,7
+18,7
@@
static int zret;
static size_t fwrite_sha1_file(void *ptr, size_t eltsize, size_t nmemb,
void *data) {
static size_t fwrite_sha1_file(void *ptr, size_t eltsize, size_t nmemb,
void *data) {
- char expn[4096];
+
unsigned
char expn[4096];
size_t size = eltsize * nmemb;
int posn = 0;
do {
size_t size = eltsize * nmemb;
int posn = 0;
do {
@@
-49,7
+43,7
@@
int fetch(unsigned char *sha1)
{
char *hex = sha1_to_hex(sha1);
char *filename = sha1_file_name(sha1);
{
char *hex = sha1_to_hex(sha1);
char *filename = sha1_file_name(sha1);
- char real_sha1[20];
+
unsigned
char real_sha1[20];
char *url;
char *posn;
char *url;
char *posn;
@@
-79,8
+73,6
@@
int fetch(unsigned char *sha1)
curl_easy_setopt(curl, CURLOPT_URL, url);
curl_easy_setopt(curl, CURLOPT_URL, url);
- /*printf("Getting %s\n", hex);*/
-
if (curl_easy_perform(curl))
return error("Couldn't get %s for %s\n", url, hex);
if (curl_easy_perform(curl))
return error("Couldn't get %s for %s\n", url, hex);
@@
-96,6
+88,7
@@
int fetch(unsigned char *sha1)
return error("File %s has bad hash\n", hex);
}
return error("File %s has bad hash\n", hex);
}
+ pull_say("got %s\n", hex);
return 0;
}
return 0;
}
@@
-110,15
+103,19
@@
int main(int argc, char **argv)
get_tree = 1;
} else if (argv[arg][1] == 'c') {
get_history = 1;
get_tree = 1;
} else if (argv[arg][1] == 'c') {
get_history = 1;
+ } else if (argv[arg][1] == 'd') {
+ get_delta = 0;
} else if (argv[arg][1] == 'a') {
get_all = 1;
get_tree = 1;
get_history = 1;
} else if (argv[arg][1] == 'a') {
get_all = 1;
get_tree = 1;
get_history = 1;
+ } else if (argv[arg][1] == 'v') {
+ get_verbosely = 1;
}
arg++;
}
if (argc < arg + 2) {
}
arg++;
}
if (argc < arg + 2) {
- usage("
http-pull [-c] [-t] [-a
] commit-id url");
+ usage("
git-http-pull [-c] [-t] [-a] [-d] [-v
] commit-id url");
return 1;
}
commit_id = argv[arg];
return 1;
}
commit_id = argv[arg];