shallow: remove unused code
Commit 58babfff ("shallow.c: the 8 steps to select new commits for .git/shallow", 05-12-2013) added a function to implement step 5 of the quoted eight steps, namely 'remove_nonexistent_ours_in_pack()'. This function implements an optional optimization step in the new shallow commit selection algorithm. However, this function has no callers. (The commented out call sites would need to change, in order to provide information required by the function.) Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Acked-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ramsay Jones committed
Jan 6, 2014 at 00:00 UTC
feefdf62c107fd63056becf547ea324dbb730e30
4 files changed
-20
builtin/receive-pack.c
-1
@@ -1059,7 +1059,6 @@ static void update_shallow_info(struct command *commands,
1059
struct command *cmd;
1060
int *ref_status;
1061
remove_nonexistent_theirs_shallow(si);
1062
- /* XXX remove_nonexistent_ours_in_pack() */
1062
if (!si->nr_ours && !si->nr_theirs) {
1063
shallow_update = 0;
1064
return;
commit.h
-2
@@ -229,8 +229,6 @@ struct shallow_info {
229
extern void prepare_shallow_info(struct shallow_info *, struct sha1_array *);
230
extern void clear_shallow_info(struct shallow_info *);
231
extern void remove_nonexistent_theirs_shallow(struct shallow_info *);
232
-extern void remove_nonexistent_ours_in_pack(struct shallow_info *,
233
- struct packed_git *);
232
extern void assign_shallow_commits_to_refs(struct shallow_info *info,
233
uint32_t **used,
234
int *ref_status);
fetch-pack.c
-1
@@ -986,7 +986,6 @@ static void update_shallow(struct fetch_pack_args *args,
986
return;
987
988
remove_nonexistent_theirs_shallow(si);
989
- /* XXX remove_nonexistent_ours_in_pack() */
989
if (!si->nr_ours && !si->nr_theirs)
990
return;
991
for (i = 0; i < nr_sought; i++)
shallow.c
-16
@@ -359,22 +359,6 @@ void remove_nonexistent_theirs_shallow(struct shallow_info *info)
359
info->nr_theirs = dst;
360
}
361
362
-/* Step 5, remove non-existent ones in "ours" in the pack */
363
-void remove_nonexistent_ours_in_pack(struct shallow_info *info,
364
- struct packed_git *p)
365
-{
366
- unsigned char (*sha1)[20] = info->shallow->sha1;
367
- int i, dst;
368
- trace_printf_key(TRACE_KEY, "shallow: remove_nonexistent_ours_in_pack\n");
369
- for (i = dst = 0; i < info->nr_ours; i++) {
370
- if (i != dst)
371
- info->ours[dst] = info->ours[i];
372
- if (find_pack_entry_one(sha1[info->ours[i]], p))
373
- dst++;
374
- }
375
- info->nr_ours = dst;
376
-}
377
-
362
define_commit_slab(ref_bitmap, uint32_t *);
363
364
struct paint_info {