Skip to content

Commit feefdf6

Browse files
Ramsay Jonesgitster
authored andcommitted
shallow: remove unused code
Commit 58babff ("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 <[email protected]> Acked-by: Nguyễn Thái Ngọc Duy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 16a2743 commit feefdf6

File tree

4 files changed

+0
-20
lines changed

4 files changed

+0
-20
lines changed

builtin/receive-pack.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1059,7 +1059,6 @@ static void update_shallow_info(struct command *commands,
10591059
struct command *cmd;
10601060
int *ref_status;
10611061
remove_nonexistent_theirs_shallow(si);
1062-
/* XXX remove_nonexistent_ours_in_pack() */
10631062
if (!si->nr_ours && !si->nr_theirs) {
10641063
shallow_update = 0;
10651064
return;

commit.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,6 @@ struct shallow_info {
229229
extern void prepare_shallow_info(struct shallow_info *, struct sha1_array *);
230230
extern void clear_shallow_info(struct shallow_info *);
231231
extern void remove_nonexistent_theirs_shallow(struct shallow_info *);
232-
extern void remove_nonexistent_ours_in_pack(struct shallow_info *,
233-
struct packed_git *);
234232
extern void assign_shallow_commits_to_refs(struct shallow_info *info,
235233
uint32_t **used,
236234
int *ref_status);

fetch-pack.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -986,7 +986,6 @@ static void update_shallow(struct fetch_pack_args *args,
986986
return;
987987

988988
remove_nonexistent_theirs_shallow(si);
989-
/* XXX remove_nonexistent_ours_in_pack() */
990989
if (!si->nr_ours && !si->nr_theirs)
991990
return;
992991
for (i = 0; i < nr_sought; i++)

shallow.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -359,22 +359,6 @@ void remove_nonexistent_theirs_shallow(struct shallow_info *info)
359359
info->nr_theirs = dst;
360360
}
361361

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-
378362
define_commit_slab(ref_bitmap, uint32_t *);
379363

380364
struct paint_info {

0 commit comments

Comments
 (0)