summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bundle.c2
-rwxr-xr-xt/t5510-fetch.sh15
2 files changed, 16 insertions, 1 deletions
diff --git a/bundle.c b/bundle.c
index 4497343e56..6c4695eb91 100644
--- a/bundle.c
+++ b/bundle.c
@@ -273,7 +273,7 @@ int create_bundle(struct bundle_header *header, const char *path,
if (!get_sha1_hex(buf.buf + 1, sha1)) {
struct object *object = parse_object(sha1);
object->flags |= UNINTERESTING;
- add_pending_object(&revs, object, buf.buf);
+ add_pending_object(&revs, object, xstrdup(buf.buf));
}
} else if (!get_sha1_hex(buf.buf, sha1)) {
struct object *object = parse_object(sha1);
diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh
index d7eca5dbab..9d72b16393 100755
--- a/t/t5510-fetch.sh
+++ b/t/t5510-fetch.sh
@@ -442,4 +442,19 @@ test_expect_success "should be able to fetch with duplicate refspecs" '
)
'
+test_expect_success 'all boundary commits are excluded' '
+ test_commit base &&
+ test_commit oneside &&
+ git checkout HEAD^ &&
+ test_commit otherside &&
+ git checkout master &&
+ test_tick &&
+ git merge otherside &&
+ ad=$(git log --no-walk --format=%ad HEAD) &&
+ git bundle create twoside-boundary.bdl master --since="$ad" &&
+ convert_bundle_to_pack <twoside-boundary.bdl >twoside-boundary.pack &&
+ pack=$(git index-pack --fix-thin --stdin <twoside-boundary.pack) &&
+ test_bundle_object_count .git/objects/pack/pack-${pack##pack }.pack 3
+'
+
test_done