Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--list-objects.c3
-rwxr-xr-xt/t6000-rev-list-misc.sh13
2 files changed, 16 insertions, 0 deletions
diff --git a/list-objects.c b/list-objects.c
index e60a6cd5b4..8bb6d3c922 100644
--- a/list-objects.c
+++ b/list-objects.c
@@ -37,6 +37,9 @@ static void show_object(struct traversal_context *ctx,
{
if (!ctx->show_object)
return;
+ if (ctx->revs->unpacked && has_object_pack(&object->oid))
+ return;
+
ctx->show_object(object, name, ctx->show_data);
}
diff --git a/t/t6000-rev-list-misc.sh b/t/t6000-rev-list-misc.sh
index 12def7bcbf..6289a2e8b0 100755
--- a/t/t6000-rev-list-misc.sh
+++ b/t/t6000-rev-list-misc.sh
@@ -169,4 +169,17 @@ test_expect_success 'rev-list --count --objects' '
test_line_count = $count actual
'
+test_expect_success 'rev-list --unpacked' '
+ git repack -ad &&
+ test_commit unpacked &&
+
+ git rev-list --objects --no-object-names unpacked^.. >expect.raw &&
+ sort expect.raw >expect &&
+
+ git rev-list --all --objects --unpacked --no-object-names >actual.raw &&
+ sort actual.raw >actual &&
+
+ test_cmp expect actual
+'
+
test_done