Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 700 lines (609 sloc) 17.103 kb
575f497 Add first cut at "git-receive-pack"
Linus Torvalds authored
1 #include "cache.h"
fc04c41 Shawn O. Pearce Teach receive-pack how to keep pack files based on object count.
spearce authored
2 #include "pack.h"
8a65ff7 Generalize the "show each ref" code in receice-pack
Linus Torvalds authored
3 #include "refs.h"
f3a3214 Make send/receive-pack be closer to doing something interesting
Linus Torvalds authored
4 #include "pkt-line.h"
b1bf95b weidendo [PATCH] Added hook in git-receive-pack
weidendo authored
5 #include "run-command.h"
576162a remove .keep pack lock files when done with refs update
Nicolas Pitre authored
6 #include "exec_cmd.h"
11031d7 dscho add receive.denyNonFastforwards config variable
dscho authored
7 #include "commit.h"
8 #include "object.h"
d79796b Junio C Hamano push: receiver end advertises refs from alternate repositories
gitster authored
9 #include "remote.h"
10 #include "transport.h"
575f497 Add first cut at "git-receive-pack"
Linus Torvalds authored
11
34263de Alexander Potashev Replace deprecated dashed git commands in usage
aspotashev authored
12 static const char receive_pack_usage[] = "git receive-pack <git-dir>";
575f497 Add first cut at "git-receive-pack"
Linus Torvalds authored
13
986e823 Jeff King receive-pack: detect push to current branch of non-bare repo
peff authored
14 enum deny_action {
3d95d92 Junio C Hamano receive-pack: explain what to do when push updates the current branch
gitster authored
15 DENY_UNCONFIGURED,
986e823 Jeff King receive-pack: detect push to current branch of non-bare repo
peff authored
16 DENY_IGNORE,
17 DENY_WARN,
18 DENY_REFUSE,
19 };
20
1b53a07 Junio C Hamano builtin-receive-pack.c: do not initialize statics to 0
gitster authored
21 static int deny_deletes;
22 static int deny_non_fast_forwards;
3d95d92 Junio C Hamano receive-pack: explain what to do when push updates the current branch
gitster authored
23 static enum deny_action deny_current_branch = DENY_UNCONFIGURED;
747ca24 Junio C Hamano receive-pack: receive.denyDeleteCurrent
gitster authored
24 static enum deny_action deny_delete_current = DENY_UNCONFIGURED;
20dc001 receive-pack: allow using --strict mode for unpacking objects
Martin Koegler authored
25 static int receive_fsck_objects;
e28714c Consolidate {receive,fetch}.unpackLimit
Junio C Hamano authored
26 static int receive_unpack_limit = -1;
27 static int transfer_unpack_limit = -1;
46732fa change the unpack limit treshold to a saner value
Nicolas Pitre authored
28 static int unpack_limit = 100;
96f1e58 remove unnecessary initializations
David Rientjes authored
29 static int report_status;
b74fce1 allow OFS_DELTA objects during a push
Nicolas Pitre authored
30 static int prefer_ofs_delta = 1;
77e3efb Junio C Hamano receive-pack: run "gc --auto --quiet" and optionally "update-server-info...
gitster authored
31 static int auto_update_server_info;
32 static int auto_gc = 1;
747ca24 Junio C Hamano receive-pack: receive.denyDeleteCurrent
gitster authored
33 static const char *head_name;
b74fce1 allow OFS_DELTA objects during a push
Nicolas Pitre authored
34 static char *capabilities_to_send;
cfee10a send-pack/receive-pack: allow errors to be reported back to pusher.
Junio C Hamano authored
35
986e823 Jeff King receive-pack: detect push to current branch of non-bare repo
peff authored
36 static enum deny_action parse_deny_action(const char *var, const char *value)
37 {
38 if (value) {
39 if (!strcasecmp(value, "ignore"))
40 return DENY_IGNORE;
41 if (!strcasecmp(value, "warn"))
42 return DENY_WARN;
43 if (!strcasecmp(value, "refuse"))
44 return DENY_REFUSE;
45 }
46 if (git_config_bool(var, value))
47 return DENY_REFUSE;
48 return DENY_IGNORE;
49 }
50
ef90d6d dscho Provide git_config with a callback-data parameter
dscho authored
51 static int receive_pack_config(const char *var, const char *value, void *cb)
6fb75be Shawn O. Pearce Move deny_non_fast_forwards handling completely into receive-pack.
spearce authored
52 {
a240de1 Jan Krüger Introduce receive.denyDeletes
jast authored
53 if (strcmp(var, "receive.denydeletes") == 0) {
54 deny_deletes = git_config_bool(var, value);
55 return 0;
56 }
57
e28714c Consolidate {receive,fetch}.unpackLimit
Junio C Hamano authored
58 if (strcmp(var, "receive.denynonfastforwards") == 0) {
6fb75be Shawn O. Pearce Move deny_non_fast_forwards handling completely into receive-pack.
spearce authored
59 deny_non_fast_forwards = git_config_bool(var, value);
60 return 0;
61 }
62
e28714c Consolidate {receive,fetch}.unpackLimit
Junio C Hamano authored
63 if (strcmp(var, "receive.unpacklimit") == 0) {
64 receive_unpack_limit = git_config_int(var, value);
fc04c41 Shawn O. Pearce Teach receive-pack how to keep pack files based on object count.
spearce authored
65 return 0;
66 }
67
e28714c Consolidate {receive,fetch}.unpackLimit
Junio C Hamano authored
68 if (strcmp(var, "transfer.unpacklimit") == 0) {
69 transfer_unpack_limit = git_config_int(var, value);
70 return 0;
71 }
72
20dc001 receive-pack: allow using --strict mode for unpacking objects
Martin Koegler authored
73 if (strcmp(var, "receive.fsckobjects") == 0) {
74 receive_fsck_objects = git_config_bool(var, value);
75 return 0;
76 }
77
986e823 Jeff King receive-pack: detect push to current branch of non-bare repo
peff authored
78 if (!strcmp(var, "receive.denycurrentbranch")) {
79 deny_current_branch = parse_deny_action(var, value);
80 return 0;
81 }
82
747ca24 Junio C Hamano receive-pack: receive.denyDeleteCurrent
gitster authored
83 if (strcmp(var, "receive.denydeletecurrent") == 0) {
84 deny_delete_current = parse_deny_action(var, value);
85 return 0;
86 }
87
b74fce1 allow OFS_DELTA objects during a push
Nicolas Pitre authored
88 if (strcmp(var, "repack.usedeltabaseoffset") == 0) {
89 prefer_ofs_delta = git_config_bool(var, value);
90 return 0;
91 }
92
77e3efb Junio C Hamano receive-pack: run "gc --auto --quiet" and optionally "update-server-info...
gitster authored
93 if (strcmp(var, "receive.updateserverinfo") == 0) {
94 auto_update_server_info = git_config_bool(var, value);
95 return 0;
96 }
97
98 if (strcmp(var, "receive.autogc") == 0) {
99 auto_gc = git_config_bool(var, value);
100 return 0;
101 }
102
ef90d6d dscho Provide git_config with a callback-data parameter
dscho authored
103 return git_default_config(var, value, cb);
6fb75be Shawn O. Pearce Move deny_non_fast_forwards handling completely into receive-pack.
spearce authored
104 }
105
8da1977 Tell between packed, unpacked and symbolic refs.
Junio C Hamano authored
106 static int show_ref(const char *path, const unsigned char *sha1, int flag, void *cb_data)
575f497 Add first cut at "git-receive-pack"
Linus Torvalds authored
107 {
b74fce1 allow OFS_DELTA objects during a push
Nicolas Pitre authored
108 if (!capabilities_to_send)
cfee10a send-pack/receive-pack: allow errors to be reported back to pusher.
Junio C Hamano authored
109 packet_write(1, "%s %s\n", sha1_to_hex(sha1), path);
110 else
111 packet_write(1, "%s %s%c%s\n",
b74fce1 allow OFS_DELTA objects during a push
Nicolas Pitre authored
112 sha1_to_hex(sha1), path, 0, capabilities_to_send);
113 capabilities_to_send = NULL;
8a65ff7 Generalize the "show each ref" code in receice-pack
Linus Torvalds authored
114 return 0;
575f497 Add first cut at "git-receive-pack"
Linus Torvalds authored
115 }
116
8a65ff7 Generalize the "show each ref" code in receice-pack
Linus Torvalds authored
117 static void write_head_info(void)
575f497 Add first cut at "git-receive-pack"
Linus Torvalds authored
118 {
cb5d709 Add callback data to for_each_ref() family.
Junio C Hamano authored
119 for_each_ref(show_ref, NULL);
b74fce1 allow OFS_DELTA objects during a push
Nicolas Pitre authored
120 if (capabilities_to_send)
8da1977 Tell between packed, unpacked and symbolic refs.
Junio C Hamano authored
121 show_ref("capabilities^{}", null_sha1, 0, NULL);
cfee10a send-pack/receive-pack: allow errors to be reported back to pusher.
Junio C Hamano authored
122
575f497 Add first cut at "git-receive-pack"
Linus Torvalds authored
123 }
124
eb1af2d git-receive-pack: start parsing ref update commands
Linus Torvalds authored
125 struct command {
126 struct command *next;
cfee10a send-pack/receive-pack: allow errors to be reported back to pusher.
Junio C Hamano authored
127 const char *error_string;
eb1af2d git-receive-pack: start parsing ref update commands
Linus Torvalds authored
128 unsigned char old_sha1[20];
129 unsigned char new_sha1[20];
8f1d2e6 [PATCH] Compilation: zero-length array declaration.
Junio C Hamano authored
130 char ref_name[FLEX_ARRAY]; /* more */
575f497 Add first cut at "git-receive-pack"
Linus Torvalds authored
131 };
132
96f1e58 remove unnecessary initializations
David Rientjes authored
133 static struct command *commands;
575f497 Add first cut at "git-receive-pack"
Linus Torvalds authored
134
05ef58e Shawn O. Pearce Teach receive-pack to run pre-receive/post-receive hooks
spearce authored
135 static const char pre_receive_hook[] = "hooks/pre-receive";
136 static const char post_receive_hook[] = "hooks/post-receive";
b1bf95b weidendo [PATCH] Added hook in git-receive-pack
weidendo authored
137
ae98a00 Stephan Beyer Move run_hook() from builtin-commit.c into run-command.c (libgit)
sbeyer authored
138 static int run_receive_hook(const char *hook_name)
b1bf95b weidendo [PATCH] Added hook in git-receive-pack
weidendo authored
139 {
f43cd49 Shawn O. Pearce Change {pre,post}-receive hooks to use stdin
spearce authored
140 static char buf[sizeof(commands->old_sha1) * 2 + PATH_MAX + 4];
c8dd277 Shawn O. Pearce Refactor run_update_hook to be more useful
spearce authored
141 struct command *cmd;
f43cd49 Shawn O. Pearce Change {pre,post}-receive hooks to use stdin
spearce authored
142 struct child_process proc;
143 const char *argv[2];
144 int have_input = 0, code;
c8dd277 Shawn O. Pearce Refactor run_update_hook to be more useful
spearce authored
145
f43cd49 Shawn O. Pearce Change {pre,post}-receive hooks to use stdin
spearce authored
146 for (cmd = commands; !have_input && cmd; cmd = cmd->next) {
c8dd277 Shawn O. Pearce Refactor run_update_hook to be more useful
spearce authored
147 if (!cmd->error_string)
f43cd49 Shawn O. Pearce Change {pre,post}-receive hooks to use stdin
spearce authored
148 have_input = 1;
c8dd277 Shawn O. Pearce Refactor run_update_hook to be more useful
spearce authored
149 }
b1bf95b weidendo [PATCH] Added hook in git-receive-pack
weidendo authored
150
f43cd49 Shawn O. Pearce Change {pre,post}-receive hooks to use stdin
spearce authored
151 if (!have_input || access(hook_name, X_OK) < 0)
b1bf95b weidendo [PATCH] Added hook in git-receive-pack
weidendo authored
152 return 0;
c8dd277 Shawn O. Pearce Refactor run_update_hook to be more useful
spearce authored
153
154 argv[0] = hook_name;
f43cd49 Shawn O. Pearce Change {pre,post}-receive hooks to use stdin
spearce authored
155 argv[1] = NULL;
156
157 memset(&proc, 0, sizeof(proc));
158 proc.argv = argv;
159 proc.in = -1;
160 proc.stdout_to_stderr = 1;
161
162 code = start_command(&proc);
163 if (code)
90e41a8 receive-pack: remove unnecessary run_status report
Johannes Sixt authored
164 return code;
f43cd49 Shawn O. Pearce Change {pre,post}-receive hooks to use stdin
spearce authored
165 for (cmd = commands; cmd; cmd = cmd->next) {
c8dd277 Shawn O. Pearce Refactor run_update_hook to be more useful
spearce authored
166 if (!cmd->error_string) {
f43cd49 Shawn O. Pearce Change {pre,post}-receive hooks to use stdin
spearce authored
167 size_t n = snprintf(buf, sizeof(buf), "%s %s %s\n",
168 sha1_to_hex(cmd->old_sha1),
169 sha1_to_hex(cmd->new_sha1),
170 cmd->ref_name);
171 if (write_in_full(proc.in, buf, n) != n)
172 break;
c8dd277 Shawn O. Pearce Refactor run_update_hook to be more useful
spearce authored
173 }
174 }
e72ae28 start_command(), .in/.out/.err = -1: Callers must close the file descrip...
Johannes Sixt authored
175 close(proc.in);
90e41a8 receive-pack: remove unnecessary run_status report
Johannes Sixt authored
176 return finish_command(&proc);
b1bf95b weidendo [PATCH] Added hook in git-receive-pack
weidendo authored
177 }
178
1d9e8b5 Shawn O. Pearce Split back out update_hook handling in receive-pack
spearce authored
179 static int run_update_hook(struct command *cmd)
180 {
181 static const char update_hook[] = "hooks/update";
182 const char *argv[5];
183
184 if (access(update_hook, X_OK) < 0)
185 return 0;
186
187 argv[0] = update_hook;
188 argv[1] = cmd->ref_name;
189 argv[2] = sha1_to_hex(cmd->old_sha1);
190 argv[3] = sha1_to_hex(cmd->new_sha1);
191 argv[4] = NULL;
192
90e41a8 receive-pack: remove unnecessary run_status report
Johannes Sixt authored
193 return run_command_v_opt(argv, RUN_COMMAND_NO_STDIN |
194 RUN_COMMAND_STDOUT_TO_STDERR);
1d9e8b5 Shawn O. Pearce Split back out update_hook handling in receive-pack
spearce authored
195 }
196
986e823 Jeff King receive-pack: detect push to current branch of non-bare repo
peff authored
197 static int is_ref_checked_out(const char *ref)
198 {
199 if (is_bare_repository())
200 return 0;
201
747ca24 Junio C Hamano receive-pack: receive.denyDeleteCurrent
gitster authored
202 if (!head_name)
986e823 Jeff King receive-pack: detect push to current branch of non-bare repo
peff authored
203 return 0;
747ca24 Junio C Hamano receive-pack: receive.denyDeleteCurrent
gitster authored
204 return !strcmp(head_name, ref);
986e823 Jeff King receive-pack: detect push to current branch of non-bare repo
peff authored
205 }
206
acd2a45 Junio C Hamano Refuse updating the current branch in a non-bare repository via push
gitster authored
207 static char *refuse_unconfigured_deny_msg[] = {
208 "By default, updating the current branch in a non-bare repository",
209 "is denied, because it will make the index and work tree inconsistent",
210 "with what you pushed, and will require 'git reset --hard' to match",
211 "the work tree to HEAD.",
3d95d92 Junio C Hamano receive-pack: explain what to do when push updates the current branch
gitster authored
212 "",
213 "You can set 'receive.denyCurrentBranch' configuration variable to",
acd2a45 Junio C Hamano Refuse updating the current branch in a non-bare repository via push
gitster authored
214 "'ignore' or 'warn' in the remote repository to allow pushing into",
215 "its current branch; however, this is not recommended unless you",
216 "arranged to update its work tree to match what you pushed in some",
217 "other way.",
3d95d92 Junio C Hamano receive-pack: explain what to do when push updates the current branch
gitster authored
218 "",
acd2a45 Junio C Hamano Refuse updating the current branch in a non-bare repository via push
gitster authored
219 "To squelch this message and still keep the default behaviour, set",
220 "'receive.denyCurrentBranch' configuration variable to 'refuse'."
3d95d92 Junio C Hamano receive-pack: explain what to do when push updates the current branch
gitster authored
221 };
222
acd2a45 Junio C Hamano Refuse updating the current branch in a non-bare repository via push
gitster authored
223 static void refuse_unconfigured_deny(void)
3d95d92 Junio C Hamano receive-pack: explain what to do when push updates the current branch
gitster authored
224 {
225 int i;
acd2a45 Junio C Hamano Refuse updating the current branch in a non-bare repository via push
gitster authored
226 for (i = 0; i < ARRAY_SIZE(refuse_unconfigured_deny_msg); i++)
227 error("%s", refuse_unconfigured_deny_msg[i]);
3d95d92 Junio C Hamano receive-pack: explain what to do when push updates the current branch
gitster authored
228 }
229
375881f Junio C Hamano Refuse deleting the current branch via push
gitster authored
230 static char *refuse_unconfigured_deny_delete_current_msg[] = {
231 "By default, deleting the current branch is denied, because the next",
232 "'git clone' won't result in any file checked out, causing confusion.",
747ca24 Junio C Hamano receive-pack: receive.denyDeleteCurrent
gitster authored
233 "",
234 "You can set 'receive.denyDeleteCurrent' configuration variable to",
375881f Junio C Hamano Refuse deleting the current branch via push
gitster authored
235 "'warn' or 'ignore' in the remote repository to allow deleting the",
236 "current branch, with or without a warning message.",
747ca24 Junio C Hamano receive-pack: receive.denyDeleteCurrent
gitster authored
237 "",
375881f Junio C Hamano Refuse deleting the current branch via push
gitster authored
238 "To squelch this message, you can set it to 'refuse'."
747ca24 Junio C Hamano receive-pack: receive.denyDeleteCurrent
gitster authored
239 };
240
375881f Junio C Hamano Refuse deleting the current branch via push
gitster authored
241 static void refuse_unconfigured_deny_delete_current(void)
747ca24 Junio C Hamano receive-pack: receive.denyDeleteCurrent
gitster authored
242 {
243 int i;
244 for (i = 0;
375881f Junio C Hamano Refuse deleting the current branch via push
gitster authored
245 i < ARRAY_SIZE(refuse_unconfigured_deny_delete_current_msg);
747ca24 Junio C Hamano receive-pack: receive.denyDeleteCurrent
gitster authored
246 i++)
375881f Junio C Hamano Refuse deleting the current branch via push
gitster authored
247 error("%s", refuse_unconfigured_deny_delete_current_msg[i]);
747ca24 Junio C Hamano receive-pack: receive.denyDeleteCurrent
gitster authored
248 }
249
8aaf7d6 Shawn O. Pearce Refactor handling of error_string in receive-pack
spearce authored
250 static const char *update(struct command *cmd)
2eca23d git-receive-pack: implement ref switch command handling
Linus Torvalds authored
251 {
cfee10a send-pack/receive-pack: allow errors to be reported back to pusher.
Junio C Hamano authored
252 const char *name = cmd->ref_name;
253 unsigned char *old_sha1 = cmd->old_sha1;
254 unsigned char *new_sha1 = cmd->new_sha1;
3159c8d Teach receive-pack about ref-log
Junio C Hamano authored
255 struct ref_lock *lock;
2eca23d git-receive-pack: implement ref switch command handling
Linus Torvalds authored
256
061d6b9 receive-pack: reject invalid refnames
Martin Koegler authored
257 /* only refs/... are allowed */
258 if (prefixcmp(name, "refs/") || check_ref_format(name + 5)) {
0b8293f Improve receive-pack error message about funny ref creation
Joakim Tjernlund authored
259 error("refusing to create funny ref '%s' remotely", name);
8aaf7d6 Shawn O. Pearce Refactor handling of error_string in receive-pack
spearce authored
260 return "funny refname";
cfee10a send-pack/receive-pack: allow errors to be reported back to pusher.
Junio C Hamano authored
261 }
d8a1dee Refuse to create funny refs in clone-pack, git-fetch and receive-pack.
Junio C Hamano authored
262
3d95d92 Junio C Hamano receive-pack: explain what to do when push updates the current branch
gitster authored
263 if (is_ref_checked_out(name)) {
264 switch (deny_current_branch) {
265 case DENY_IGNORE:
986e823 Jeff King receive-pack: detect push to current branch of non-bare repo
peff authored
266 break;
3d95d92 Junio C Hamano receive-pack: explain what to do when push updates the current branch
gitster authored
267 case DENY_WARN:
268 warning("updating the current branch");
986e823 Jeff King receive-pack: detect push to current branch of non-bare repo
peff authored
269 break;
3d95d92 Junio C Hamano receive-pack: explain what to do when push updates the current branch
gitster authored
270 case DENY_REFUSE:
acd2a45 Junio C Hamano Refuse updating the current branch in a non-bare repository via push
gitster authored
271 case DENY_UNCONFIGURED:
3d95d92 Junio C Hamano receive-pack: explain what to do when push updates the current branch
gitster authored
272 error("refusing to update checked out branch: %s", name);
acd2a45 Junio C Hamano Refuse updating the current branch in a non-bare repository via push
gitster authored
273 if (deny_current_branch == DENY_UNCONFIGURED)
274 refuse_unconfigured_deny();
3d95d92 Junio C Hamano receive-pack: explain what to do when push updates the current branch
gitster authored
275 return "branch is currently checked out";
276 }
986e823 Jeff King receive-pack: detect push to current branch of non-bare repo
peff authored
277 }
278
d4f694b Allow git push to delete remote ref.
Junio C Hamano authored
279 if (!is_null_sha1(new_sha1) && !has_sha1_file(new_sha1)) {
8aaf7d6 Shawn O. Pearce Refactor handling of error_string in receive-pack
spearce authored
280 error("unpack should have generated %s, "
281 "but I can't find it!", sha1_to_hex(new_sha1));
282 return "bad pack";
cfee10a send-pack/receive-pack: allow errors to be reported back to pusher.
Junio C Hamano authored
283 }
747ca24 Junio C Hamano receive-pack: receive.denyDeleteCurrent
gitster authored
284
285 if (!is_null_sha1(old_sha1) && is_null_sha1(new_sha1)) {
286 if (deny_deletes && !prefixcmp(name, "refs/heads/")) {
287 error("denying ref deletion for %s", name);
288 return "deletion prohibited";
289 }
290
291 if (!strcmp(name, head_name)) {
292 switch (deny_delete_current) {
293 case DENY_IGNORE:
294 break;
295 case DENY_WARN:
296 warning("deleting the current branch");
297 break;
298 case DENY_REFUSE:
375881f Junio C Hamano Refuse deleting the current branch via push
gitster authored
299 case DENY_UNCONFIGURED:
300 if (deny_delete_current == DENY_UNCONFIGURED)
301 refuse_unconfigured_deny_delete_current();
747ca24 Junio C Hamano receive-pack: receive.denyDeleteCurrent
gitster authored
302 error("refusing to delete the current branch: %s", name);
303 return "deletion of the current branch prohibited";
304 }
305 }
a240de1 Jan Krüger Introduce receive.denyDeletes
jast authored
306 }
747ca24 Junio C Hamano receive-pack: receive.denyDeleteCurrent
gitster authored
307
d4f694b Allow git push to delete remote ref.
Junio C Hamano authored
308 if (deny_non_fast_forwards && !is_null_sha1(new_sha1) &&
ba988a8 Merge branch 'maint'
Junio C Hamano authored
309 !is_null_sha1(old_sha1) &&
cc44c76 Mechanical conversion to use prefixcmp()
Junio C Hamano authored
310 !prefixcmp(name, "refs/heads/")) {
eab8270 receive-pack: check object type of sha1 before using them as commits
Martin Koegler authored
311 struct object *old_object, *new_object;
11031d7 dscho add receive.denyNonFastforwards config variable
dscho authored
312 struct commit *old_commit, *new_commit;
9edd7e4 dscho receive-pack: plug memory leak in fast-forward checking code.
dscho authored
313 struct commit_list *bases, *ent;
11031d7 dscho add receive.denyNonFastforwards config variable
dscho authored
314
eab8270 receive-pack: check object type of sha1 before using them as commits
Martin Koegler authored
315 old_object = parse_object(old_sha1);
316 new_object = parse_object(new_sha1);
317
318 if (!old_object || !new_object ||
319 old_object->type != OBJ_COMMIT ||
320 new_object->type != OBJ_COMMIT) {
321 error("bad sha1 objects for %s", name);
322 return "bad ref";
323 }
324 old_commit = (struct commit *)old_object;
325 new_commit = (struct commit *)new_object;
9edd7e4 dscho receive-pack: plug memory leak in fast-forward checking code.
dscho authored
326 bases = get_merge_bases(old_commit, new_commit, 1);
327 for (ent = bases; ent; ent = ent->next)
328 if (!hashcmp(old_sha1, ent->item->object.sha1))
11031d7 dscho add receive.denyNonFastforwards config variable
dscho authored
329 break;
9edd7e4 dscho receive-pack: plug memory leak in fast-forward checking code.
dscho authored
330 free_commit_list(bases);
8aaf7d6 Shawn O. Pearce Refactor handling of error_string in receive-pack
spearce authored
331 if (!ent) {
a75d7b5 Felipe Contreras Use 'fast-forward' all over the place
felipec authored
332 error("denying non-fast-forward %s"
8aaf7d6 Shawn O. Pearce Refactor handling of error_string in receive-pack
spearce authored
333 " (you should pull first)", name);
a75d7b5 Felipe Contreras Use 'fast-forward' all over the place
felipec authored
334 return "non-fast-forward";
8aaf7d6 Shawn O. Pearce Refactor handling of error_string in receive-pack
spearce authored
335 }
11031d7 dscho add receive.denyNonFastforwards config variable
dscho authored
336 }
1d9e8b5 Shawn O. Pearce Split back out update_hook handling in receive-pack
spearce authored
337 if (run_update_hook(cmd)) {
8aaf7d6 Shawn O. Pearce Refactor handling of error_string in receive-pack
spearce authored
338 error("hook declined to update %s", name);
339 return "hook declined";
b1bf95b weidendo [PATCH] Added hook in git-receive-pack
weidendo authored
340 }
3159c8d Teach receive-pack about ref-log
Junio C Hamano authored
341
d4f694b Allow git push to delete remote ref.
Junio C Hamano authored
342 if (is_null_sha1(new_sha1)) {
28391a8 dscho receive-pack: allow deletion of corrupt refs
dscho authored
343 if (!parse_object(old_sha1)) {
344 warning ("Allowing deletion of corrupt ref.");
345 old_sha1 = NULL;
346 }
eca35a2 Fix git branch -m for symrefs.
Miklos Vajna authored
347 if (delete_ref(name, old_sha1, 0)) {
8aaf7d6 Shawn O. Pearce Refactor handling of error_string in receive-pack
spearce authored
348 error("failed to delete %s", name);
349 return "failed to delete";
d4f694b Allow git push to delete remote ref.
Junio C Hamano authored
350 }
8aaf7d6 Shawn O. Pearce Refactor handling of error_string in receive-pack
spearce authored
351 return NULL; /* good */
d4f694b Allow git push to delete remote ref.
Junio C Hamano authored
352 }
353 else {
68db31c git-update-ref: add --no-deref option for overwriting/detaching ref
Sven Verdoolaege authored
354 lock = lock_any_ref_for_update(name, old_sha1, 0);
d4f694b Allow git push to delete remote ref.
Junio C Hamano authored
355 if (!lock) {
8aaf7d6 Shawn O. Pearce Refactor handling of error_string in receive-pack
spearce authored
356 error("failed to lock %s", name);
357 return "failed to lock";
d4f694b Allow git push to delete remote ref.
Junio C Hamano authored
358 }
ef203f0 Shawn O. Pearce Catch write_ref_sha1 failure in receive-pack
spearce authored
359 if (write_ref_sha1(lock, new_sha1, "push")) {
8aaf7d6 Shawn O. Pearce Refactor handling of error_string in receive-pack
spearce authored
360 return "failed to write"; /* error() already called */
ef203f0 Shawn O. Pearce Catch write_ref_sha1 failure in receive-pack
spearce authored
361 }
8aaf7d6 Shawn O. Pearce Refactor handling of error_string in receive-pack
spearce authored
362 return NULL; /* good */
1961433 receive-pack hooks updates.
Junio C Hamano authored
363 }
2eca23d git-receive-pack: implement ref switch command handling
Linus Torvalds authored
364 }
365
1961433 receive-pack hooks updates.
Junio C Hamano authored
366 static char update_post_hook[] = "hooks/post-update";
367
368 static void run_update_post_hook(struct command *cmd)
369 {
370 struct command *cmd_p;
2ff4d1a receive-pack: do not send error details to the client
Johannes Sixt authored
371 int argc, status;
9201c70 Const tightening.
Junio C Hamano authored
372 const char **argv;
1961433 receive-pack hooks updates.
Junio C Hamano authored
373
3e6e152 Shawn O. Pearce Don't run post-update hook unless a ref changed
spearce authored
374 for (argc = 0, cmd_p = cmd; cmd_p; cmd_p = cmd_p->next) {
cfee10a send-pack/receive-pack: allow errors to be reported back to pusher.
Junio C Hamano authored
375 if (cmd_p->error_string)
1961433 receive-pack hooks updates.
Junio C Hamano authored
376 continue;
377 argc++;
378 }
3e6e152 Shawn O. Pearce Don't run post-update hook unless a ref changed
spearce authored
379 if (!argc || access(update_post_hook, X_OK) < 0)
380 return;
381 argv = xmalloc(sizeof(*argv) * (2 + argc));
1961433 receive-pack hooks updates.
Junio C Hamano authored
382 argv[0] = update_post_hook;
383
384 for (argc = 1, cmd_p = cmd; cmd_p; cmd_p = cmd_p->next) {
9201c70 Const tightening.
Junio C Hamano authored
385 char *p;
cfee10a send-pack/receive-pack: allow errors to be reported back to pusher.
Junio C Hamano authored
386 if (cmd_p->error_string)
1961433 receive-pack hooks updates.
Junio C Hamano authored
387 continue;
9201c70 Const tightening.
Junio C Hamano authored
388 p = xmalloc(strlen(cmd_p->ref_name) + 1);
389 strcpy(p, cmd_p->ref_name);
390 argv[argc] = p;
1961433 receive-pack hooks updates.
Junio C Hamano authored
391 argc++;
392 }
393 argv[argc] = NULL;
2ff4d1a receive-pack: do not send error details to the client
Johannes Sixt authored
394 status = run_command_v_opt(argv, RUN_COMMAND_NO_STDIN
395 | RUN_COMMAND_STDOUT_TO_STDERR);
1961433 receive-pack hooks updates.
Junio C Hamano authored
396 }
2eca23d git-receive-pack: implement ref switch command handling
Linus Torvalds authored
397
8aaf7d6 Shawn O. Pearce Refactor handling of error_string in receive-pack
spearce authored
398 static void execute_commands(const char *unpacker_error)
575f497 Add first cut at "git-receive-pack"
Linus Torvalds authored
399 {
eb1af2d git-receive-pack: start parsing ref update commands
Linus Torvalds authored
400 struct command *cmd = commands;
747ca24 Junio C Hamano receive-pack: receive.denyDeleteCurrent
gitster authored
401 unsigned char sha1[20];
8aaf7d6 Shawn O. Pearce Refactor handling of error_string in receive-pack
spearce authored
402
403 if (unpacker_error) {
404 while (cmd) {
405 cmd->error_string = "n/a (unpacker error)";
406 cmd = cmd->next;
407 }
408 return;
409 }
410
ae98a00 Stephan Beyer Move run_hook() from builtin-commit.c into run-command.c (libgit)
sbeyer authored
411 if (run_receive_hook(pre_receive_hook)) {
05ef58e Shawn O. Pearce Teach receive-pack to run pre-receive/post-receive hooks
spearce authored
412 while (cmd) {
413 cmd->error_string = "pre-receive hook declined";
414 cmd = cmd->next;
415 }
416 return;
417 }
418
747ca24 Junio C Hamano receive-pack: receive.denyDeleteCurrent
gitster authored
419 head_name = resolve_ref("HEAD", sha1, 0, NULL);
420
eb1af2d git-receive-pack: start parsing ref update commands
Linus Torvalds authored
421 while (cmd) {
8aaf7d6 Shawn O. Pearce Refactor handling of error_string in receive-pack
spearce authored
422 cmd->error_string = update(cmd);
eb1af2d git-receive-pack: start parsing ref update commands
Linus Torvalds authored
423 cmd = cmd->next;
575f497 Add first cut at "git-receive-pack"
Linus Torvalds authored
424 }
425 }
426
427 static void read_head_info(void)
428 {
eb1af2d git-receive-pack: start parsing ref update commands
Linus Torvalds authored
429 struct command **p = &commands;
575f497 Add first cut at "git-receive-pack"
Linus Torvalds authored
430 for (;;) {
431 static char line[1000];
eb1af2d git-receive-pack: start parsing ref update commands
Linus Torvalds authored
432 unsigned char old_sha1[20], new_sha1[20];
433 struct command *cmd;
cfee10a send-pack/receive-pack: allow errors to be reported back to pusher.
Junio C Hamano authored
434 char *refname;
435 int len, reflen;
eb1af2d git-receive-pack: start parsing ref update commands
Linus Torvalds authored
436
437 len = packet_read_line(0, line, sizeof(line));
575f497 Add first cut at "git-receive-pack"
Linus Torvalds authored
438 if (!len)
439 break;
eb1af2d git-receive-pack: start parsing ref update commands
Linus Torvalds authored
440 if (line[len-1] == '\n')
441 line[--len] = 0;
442 if (len < 83 ||
443 line[40] != ' ' ||
444 line[81] != ' ' ||
445 get_sha1_hex(line, old_sha1) ||
446 get_sha1_hex(line + 41, new_sha1))
cfee10a send-pack/receive-pack: allow errors to be reported back to pusher.
Junio C Hamano authored
447 die("protocol error: expected old/new/ref, got '%s'",
448 line);
449
450 refname = line + 82;
451 reflen = strlen(refname);
452 if (reflen + 82 < len) {
453 if (strstr(refname + reflen + 1, "report-status"))
454 report_status = 1;
455 }
eb1af2d git-receive-pack: start parsing ref update commands
Linus Torvalds authored
456 cmd = xmalloc(sizeof(struct command) + len - 80);
e702496 Shawn O. Pearce Convert memcpy(a,b,20) to hashcpy(a,b).
spearce authored
457 hashcpy(cmd->old_sha1, old_sha1);
458 hashcpy(cmd->new_sha1, new_sha1);
eb1af2d git-receive-pack: start parsing ref update commands
Linus Torvalds authored
459 memcpy(cmd->ref_name, line + 82, len - 81);
8aaf7d6 Shawn O. Pearce Refactor handling of error_string in receive-pack
spearce authored
460 cmd->error_string = NULL;
eb1af2d git-receive-pack: start parsing ref update commands
Linus Torvalds authored
461 cmd->next = NULL;
462 *p = cmd;
463 p = &cmd->next;
575f497 Add first cut at "git-receive-pack"
Linus Torvalds authored
464 }
465 }
466
fc04c41 Shawn O. Pearce Teach receive-pack how to keep pack files based on object count.
spearce authored
467 static const char *parse_pack_header(struct pack_header *hdr)
468 {
a69e542 Refactor the pack header reading function out of receive-pack.c
Junio C Hamano authored
469 switch (read_pack_header(0, hdr)) {
470 case PH_ERROR_EOF:
471 return "eof before pack header was fully read";
472
473 case PH_ERROR_PACK_SIGNATURE:
fc04c41 Shawn O. Pearce Teach receive-pack how to keep pack files based on object count.
spearce authored
474 return "protocol error (pack signature mismatch detected)";
a69e542 Refactor the pack header reading function out of receive-pack.c
Junio C Hamano authored
475
476 case PH_ERROR_PROTOCOL:
fc04c41 Shawn O. Pearce Teach receive-pack how to keep pack files based on object count.
spearce authored
477 return "protocol error (pack version unsupported)";
a69e542 Refactor the pack header reading function out of receive-pack.c
Junio C Hamano authored
478
479 default:
480 return "unknown error in parse_pack_header";
481
482 case 0:
483 return NULL;
484 }
fc04c41 Shawn O. Pearce Teach receive-pack how to keep pack files based on object count.
spearce authored
485 }
486
576162a remove .keep pack lock files when done with refs update
Nicolas Pitre authored
487 static const char *pack_lockfile;
488
861ed12 Shawn O. Pearce Remove unused variable in receive-pack.
spearce authored
489 static const char *unpack(void)
575f497 Add first cut at "git-receive-pack"
Linus Torvalds authored
490 {
fc04c41 Shawn O. Pearce Teach receive-pack how to keep pack files based on object count.
spearce authored
491 struct pack_header hdr;
492 const char *hdr_err;
493 char hdr_arg[38];
494
495 hdr_err = parse_pack_header(&hdr);
496 if (hdr_err)
497 return hdr_err;
6e1c234 Fix some warnings (on cygwin) to allow -Werror
Ramsay Jones authored
498 snprintf(hdr_arg, sizeof(hdr_arg),
499 "--pack_header=%"PRIu32",%"PRIu32,
fc04c41 Shawn O. Pearce Teach receive-pack how to keep pack files based on object count.
spearce authored
500 ntohl(hdr.hdr_version), ntohl(hdr.hdr_entries));
501
502 if (ntohl(hdr.hdr_entries) < unpack_limit) {
20dc001 receive-pack: allow using --strict mode for unpacking objects
Martin Koegler authored
503 int code, i = 0;
504 const char *unpacker[4];
505 unpacker[i++] = "unpack-objects";
506 if (receive_fsck_objects)
507 unpacker[i++] = "--strict";
508 unpacker[i++] = hdr_arg;
509 unpacker[i++] = NULL;
9b0b509 Shawn O. Pearce Remove unnecessary argc parameter from run_command_v.
spearce authored
510 code = run_command_v_opt(unpacker, RUN_GIT_CMD);
2ff4d1a receive-pack: do not send error details to the client
Johannes Sixt authored
511 if (!code)
fc04c41 Shawn O. Pearce Teach receive-pack how to keep pack files based on object count.
spearce authored
512 return NULL;
2ff4d1a receive-pack: do not send error details to the client
Johannes Sixt authored
513 return "unpack-objects abnormal exit";
576162a remove .keep pack lock files when done with refs update
Nicolas Pitre authored
514 } else {
20dc001 receive-pack: allow using --strict mode for unpacking objects
Martin Koegler authored
515 const char *keeper[7];
516 int s, status, i = 0;
576162a remove .keep pack lock files when done with refs update
Nicolas Pitre authored
517 char keep_arg[256];
e8016ab Shawn O. Pearce Use run_command within receive-pack to invoke index-pack
spearce authored
518 struct child_process ip;
576162a remove .keep pack lock files when done with refs update
Nicolas Pitre authored
519
85e7283 David Soria Parra cast pid_t's to uintmax_t to improve portability
dsp authored
520 s = sprintf(keep_arg, "--keep=receive-pack %"PRIuMAX" on ", (uintmax_t) getpid());
576162a remove .keep pack lock files when done with refs update
Nicolas Pitre authored
521 if (gethostname(keep_arg + s, sizeof(keep_arg) - s))
522 strcpy(keep_arg + s, "localhost");
523
20dc001 receive-pack: allow using --strict mode for unpacking objects
Martin Koegler authored
524 keeper[i++] = "index-pack";
525 keeper[i++] = "--stdin";
526 if (receive_fsck_objects)
527 keeper[i++] = "--strict";
528 keeper[i++] = "--fix-thin";
529 keeper[i++] = hdr_arg;
530 keeper[i++] = keep_arg;
531 keeper[i++] = NULL;
e8016ab Shawn O. Pearce Use run_command within receive-pack to invoke index-pack
spearce authored
532 memset(&ip, 0, sizeof(ip));
533 ip.argv = keeper;
534 ip.out = -1;
535 ip.git_cmd = 1;
2ff4d1a receive-pack: do not send error details to the client
Johannes Sixt authored
536 status = start_command(&ip);
537 if (status) {
576162a remove .keep pack lock files when done with refs update
Nicolas Pitre authored
538 return "index-pack fork failed";
2ff4d1a receive-pack: do not send error details to the client
Johannes Sixt authored
539 }
106764e Shawn O. Pearce Refactor index-pack "keep $sha1" handling for reuse
spearce authored
540 pack_lockfile = index_pack_lockfile(ip.out);
e72ae28 start_command(), .in/.out/.err = -1: Callers must close the file descrip...
Johannes Sixt authored
541 close(ip.out);
e8016ab Shawn O. Pearce Use run_command within receive-pack to invoke index-pack
spearce authored
542 status = finish_command(&ip);
543 if (!status) {
576162a remove .keep pack lock files when done with refs update
Nicolas Pitre authored
544 reprepare_packed_git();
545 return NULL;
546 }
547 return "index-pack abnormal exit";
cfee10a send-pack/receive-pack: allow errors to be reported back to pusher.
Junio C Hamano authored
548 }
549 }
550
551 static void report(const char *unpack_status)
552 {
553 struct command *cmd;
554 packet_write(1, "unpack %s\n",
555 unpack_status ? unpack_status : "ok");
556 for (cmd = commands; cmd; cmd = cmd->next) {
557 if (!cmd->error_string)
558 packet_write(1, "ok %s\n",
559 cmd->ref_name);
560 else
561 packet_write(1, "ng %s %s\n",
562 cmd->ref_name, cmd->error_string);
575f497 Add first cut at "git-receive-pack"
Linus Torvalds authored
563 }
cfee10a send-pack/receive-pack: allow errors to be reported back to pusher.
Junio C Hamano authored
564 packet_flush(1);
575f497 Add first cut at "git-receive-pack"
Linus Torvalds authored
565 }
566
d4f694b Allow git push to delete remote ref.
Junio C Hamano authored
567 static int delete_only(struct command *cmd)
568 {
569 while (cmd) {
570 if (!is_null_sha1(cmd->new_sha1))
571 return 0;
572 cmd = cmd->next;
573 }
574 return 1;
575 }
576
d79796b Junio C Hamano push: receiver end advertises refs from alternate repositories
gitster authored
577 static int add_refs_from_alternate(struct alternate_object_database *e, void *unused)
578 {
b849253 Junio C Hamano receive-pack: fix "borrowing from alternate object store" implementation
gitster authored
579 char *other;
580 size_t len;
d79796b Junio C Hamano push: receiver end advertises refs from alternate repositories
gitster authored
581 struct remote *remote;
582 struct transport *transport;
583 const struct ref *extra;
584
b849253 Junio C Hamano receive-pack: fix "borrowing from alternate object store" implementation
gitster authored
585 e->name[-1] = '\0';
586 other = xstrdup(make_absolute_path(e->base));
587 e->name[-1] = '/';
588 len = strlen(other);
589
d79796b Junio C Hamano push: receiver end advertises refs from alternate repositories
gitster authored
590 while (other[len-1] == '/')
591 other[--len] = '\0';
592 if (len < 8 || memcmp(other + len - 8, "/objects", 8))
593 return 0;
594 /* Is this a git repository with refs? */
595 memcpy(other + len - 8, "/refs", 6);
596 if (!is_directory(other))
597 return 0;
598 other[len - 8] = '\0';
599 remote = remote_get(other);
600 transport = transport_get(remote, other);
601 for (extra = transport_get_remote_refs(transport);
602 extra;
603 extra = extra->next) {
604 add_extra_ref(".have", extra->old_sha1, 0);
605 }
606 transport_disconnect(transport);
607 free(other);
608 return 0;
609 }
610
611 static void add_alternate_refs(void)
612 {
613 foreach_alt_odb(add_refs_from_alternate, NULL);
614 }
615
be5908a Junio C Hamano receive-pack: make it a builtin
gitster authored
616 int cmd_receive_pack(int argc, const char **argv, const char *prefix)
575f497 Add first cut at "git-receive-pack"
Linus Torvalds authored
617 {
42526b4 Shawn O. Pearce Add stateless RPC options to upload-pack, receive-pack
spearce authored
618 int advertise_refs = 0;
619 int stateless_rpc = 0;
d0efc8a Do ref matching on the sender side rather than on receiver
Linus Torvalds authored
620 int i;
8d63013 Server-side support for user-relative paths.
Andreas Ericsson authored
621 char *dir = NULL;
575f497 Add first cut at "git-receive-pack"
Linus Torvalds authored
622
623 argv++;
624 for (i = 1; i < argc; i++) {
be5908a Junio C Hamano receive-pack: make it a builtin
gitster authored
625 const char *arg = *argv++;
575f497 Add first cut at "git-receive-pack"
Linus Torvalds authored
626
627 if (*arg == '-') {
42526b4 Shawn O. Pearce Add stateless RPC options to upload-pack, receive-pack
spearce authored
628 if (!strcmp(arg, "--advertise-refs")) {
629 advertise_refs = 1;
630 continue;
631 }
632 if (!strcmp(arg, "--stateless-rpc")) {
633 stateless_rpc = 1;
634 continue;
635 }
636
575f497 Add first cut at "git-receive-pack"
Linus Torvalds authored
637 usage(receive_pack_usage);
638 }
d0efc8a Do ref matching on the sender side rather than on receiver
Linus Torvalds authored
639 if (dir)
640 usage(receive_pack_usage);
be5908a Junio C Hamano receive-pack: make it a builtin
gitster authored
641 dir = xstrdup(arg);
575f497 Add first cut at "git-receive-pack"
Linus Torvalds authored
642 }
643 if (!dir)
644 usage(receive_pack_usage);
645
e1464ca Record the command invocation path early
Johannes Sixt authored
646 setup_path();
5c09f32 Björn Steinbrink receive-pack: Initialize PATH to include exec-dir.
dotdash authored
647
3159c8d Teach receive-pack about ref-log
Junio C Hamano authored
648 if (!enter_repo(dir, 0))
05ac6b3 Jeff King improve missing repository error message
peff authored
649 die("'%s' does not appear to be a git repository", dir);
575f497 Add first cut at "git-receive-pack"
Linus Torvalds authored
650
a0022ee shallow repository: disable unsupported operations for now.
Junio C Hamano authored
651 if (is_repository_shallow())
652 die("attempt to push into a shallow repository");
653
ef90d6d dscho Provide git_config with a callback-data parameter
dscho authored
654 git_config(receive_pack_config, NULL);
6fb75be Shawn O. Pearce Move deny_non_fast_forwards handling completely into receive-pack.
spearce authored
655
e28714c Consolidate {receive,fetch}.unpackLimit
Junio C Hamano authored
656 if (0 <= transfer_unpack_limit)
657 unpack_limit = transfer_unpack_limit;
658 else if (0 <= receive_unpack_limit)
659 unpack_limit = receive_unpack_limit;
660
b74fce1 allow OFS_DELTA objects during a push
Nicolas Pitre authored
661 capabilities_to_send = (prefer_ofs_delta) ?
662 " report-status delete-refs ofs-delta " :
663 " report-status delete-refs ";
664
42526b4 Shawn O. Pearce Add stateless RPC options to upload-pack, receive-pack
spearce authored
665 if (advertise_refs || !stateless_rpc) {
666 add_alternate_refs();
667 write_head_info();
668 clear_extra_refs();
575f497 Add first cut at "git-receive-pack"
Linus Torvalds authored
669
42526b4 Shawn O. Pearce Add stateless RPC options to upload-pack, receive-pack
spearce authored
670 /* EOF */
671 packet_flush(1);
672 }
673 if (advertise_refs)
674 return 0;
575f497 Add first cut at "git-receive-pack"
Linus Torvalds authored
675
676 read_head_info();
7f8e982 Slow but steady progress on git pack receive/send
Linus Torvalds authored
677 if (commands) {
d4f694b Allow git push to delete remote ref.
Junio C Hamano authored
678 const char *unpack_status = NULL;
679
680 if (!delete_only(commands))
681 unpack_status = unpack();
8aaf7d6 Shawn O. Pearce Refactor handling of error_string in receive-pack
spearce authored
682 execute_commands(unpack_status);
576162a remove .keep pack lock files when done with refs update
Nicolas Pitre authored
683 if (pack_lockfile)
691f1a2 Alex Riesen replace direct calls to unlink(2) with unlink_or_warn
raalkml authored
684 unlink_or_warn(pack_lockfile);
cfee10a send-pack/receive-pack: allow errors to be reported back to pusher.
Junio C Hamano authored
685 if (report_status)
686 report(unpack_status);
ae98a00 Stephan Beyer Move run_hook() from builtin-commit.c into run-command.c (libgit)
sbeyer authored
687 run_receive_hook(post_receive_hook);
8e663d9 Shawn O. Pearce Move post-update hook to after all other activity
spearce authored
688 run_update_post_hook(commands);
77e3efb Junio C Hamano receive-pack: run "gc --auto --quiet" and optionally "update-server-info...
gitster authored
689 if (auto_gc) {
690 const char *argv_gc_auto[] = {
691 "gc", "--auto", "--quiet", NULL,
692 };
693 run_command_v_opt(argv_gc_auto, RUN_GIT_CMD);
694 }
695 if (auto_update_server_info)
696 update_server_info(0);
7f8e982 Slow but steady progress on git pack receive/send
Linus Torvalds authored
697 }
575f497 Add first cut at "git-receive-pack"
Linus Torvalds authored
698 return 0;
699 }
Something went wrong with that request. Please try again.