shallow: remove unused code
authorRamsay Jones <ramsay@ramsay1.demon.co.uk>
Mon, 6 Jan 2014 00:00:58 +0000 (00:00 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 6 Jan 2014 17:05:40 +0000 (09:05 -0800)
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>
builtin/receive-pack.c
commit.h
fetch-pack.c
shallow.c
index 78fe8ee62fdfc45051b4f52dffc37e7fa1eb961d..bc4f5dc4632350c39972a0c1c589f10f90b120df 100644 (file)
@@ -1059,7 +1059,6 @@ static void update_shallow_info(struct command *commands,
        struct command *cmd;
        int *ref_status;
        remove_nonexistent_theirs_shallow(si);
-       /* XXX remove_nonexistent_ours_in_pack() */
        if (!si->nr_ours && !si->nr_theirs) {
                shallow_update = 0;
                return;
index affe21033707fcf58552f30c37ed2333d812fde5..2a20b10d3957d3bdbcf09d3d69f1d39f7d6f5421 100644 (file)
--- a/commit.h
+++ b/commit.h
@@ -229,8 +229,6 @@ struct shallow_info {
 extern void prepare_shallow_info(struct shallow_info *, struct sha1_array *);
 extern void clear_shallow_info(struct shallow_info *);
 extern void remove_nonexistent_theirs_shallow(struct shallow_info *);
-extern void remove_nonexistent_ours_in_pack(struct shallow_info *,
-                                           struct packed_git *);
 extern void assign_shallow_commits_to_refs(struct shallow_info *info,
                                           uint32_t **used,
                                           int *ref_status);
index a2d1b4ab28aa94b6e685cd7bac1fb18ed1a6d96d..9bc29cfce78719fbd773e5fed8a678485f8e8e0a 100644 (file)
@@ -986,7 +986,6 @@ static void update_shallow(struct fetch_pack_args *args,
                return;
 
        remove_nonexistent_theirs_shallow(si);
-       /* XXX remove_nonexistent_ours_in_pack() */
        if (!si->nr_ours && !si->nr_theirs)
                return;
        for (i = 0; i < nr_sought; i++)
index c766fc30122e07bfb3da937b9ae9effcf1133206..e483780d4916a817e5256ec325e6cbcf31eb9328 100644 (file)
--- a/shallow.c
+++ b/shallow.c
@@ -359,22 +359,6 @@ void remove_nonexistent_theirs_shallow(struct shallow_info *info)
        info->nr_theirs = dst;
 }
 
-/* Step 5, remove non-existent ones in "ours" in the pack */
-void remove_nonexistent_ours_in_pack(struct shallow_info *info,
-                                    struct packed_git *p)
-{
-       unsigned char (*sha1)[20] = info->shallow->sha1;
-       int i, dst;
-       trace_printf_key(TRACE_KEY, "shallow: remove_nonexistent_ours_in_pack\n");
-       for (i = dst = 0; i < info->nr_ours; i++) {
-               if (i != dst)
-                       info->ours[dst] = info->ours[i];
-               if (find_pack_entry_one(sha1[info->ours[i]], p))
-                       dst++;
-       }
-       info->nr_ours = dst;
-}
-
 define_commit_slab(ref_bitmap, uint32_t *);
 
 struct paint_info {