Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
upload-pack: move "shallow" sending code out of deepen()
author
Nguyễn Thái Ngọc Duy
<pclouds@gmail.com>
Sun, 12 Jun 2016 10:53:46 +0000
(17:53 +0700)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 13 Jun 2016 21:38:16 +0000
(14:38 -0700)
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
upload-pack.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
e8e44de
)
diff --git
a/upload-pack.c
b/upload-pack.c
index 97ed62002ec0b394d251cb07089c34396eaded66..0eb9a0b8fa5cb7fe9c133b1a63defccff7d1632b 100644
(file)
--- a/
upload-pack.c
+++ b/
upload-pack.c
@@
-538,6
+538,20
@@
static void check_non_tip(void)
}
}
}
}
+static void send_shallow(struct commit_list *result)
+{
+ while (result) {
+ struct object *object = &result->item->object;
+ if (!(object->flags & (CLIENT_SHALLOW|NOT_SHALLOW))) {
+ packet_write(1, "shallow %s",
+ oid_to_hex(&object->oid));
+ register_shallow(object->oid.hash);
+ shallow_nr++;
+ }
+ result = result->next;
+ }
+}
+
static void deepen(int depth, const struct object_array *shallows)
{
struct commit_list *result = NULL, *backup = NULL;
static void deepen(int depth, const struct object_array *shallows)
{
struct commit_list *result = NULL, *backup = NULL;
@@
-551,16
+565,7
@@
static void deepen(int depth, const struct object_array *shallows)
backup = result =
get_shallow_commits(&want_obj, depth,
SHALLOW, NOT_SHALLOW);
backup = result =
get_shallow_commits(&want_obj, depth,
SHALLOW, NOT_SHALLOW);
- while (result) {
- struct object *object = &result->item->object;
- if (!(object->flags & (CLIENT_SHALLOW|NOT_SHALLOW))) {
- packet_write(1, "shallow %s",
- oid_to_hex(&object->oid));
- register_shallow(object->oid.hash);
- shallow_nr++;
- }
- result = result->next;
- }
+ send_shallow(result);
free_commit_list(backup);
for (i = 0; i < shallows->nr; i++) {
struct object *object = shallows->objects[i].item;
free_commit_list(backup);
for (i = 0; i < shallows->nr; i++) {
struct object *object = shallows->objects[i].item;