-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'jk/pack-shallow-always-without-bitmap'
Reachability bitmaps do not work with shallow operations. Fixes regression in 2.0. * jk/pack-shallow-always-without-bitmap: pack-objects: turn off bitmaps when we see --shallow lines
- Loading branch information
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/sh | ||
|
||
test_description='check bitmap operation with shallow repositories' | ||
. ./test-lib.sh | ||
|
||
# We want to create a situation where the shallow, grafted | ||
# view of reachability does not match reality in a way that | ||
# might cause us to send insufficient objects. | ||
# | ||
# We do this with a history that repeats a state, like: | ||
# | ||
# A -- B -- C | ||
# file=1 file=2 file=1 | ||
# | ||
# and then create a shallow clone to the second commit, B. | ||
# In a non-shallow clone, that would mean we already have | ||
# the tree for A. But in a shallow one, we've grafted away | ||
# A, and fetching A to B requires that the other side send | ||
# us the tree for file=1. | ||
test_expect_success 'setup shallow repo' ' | ||
echo 1 >file && | ||
git add file && | ||
git commit -m orig && | ||
echo 2 >file && | ||
git commit -a -m update && | ||
git clone --no-local --bare --depth=1 . shallow.git && | ||
echo 1 >file && | ||
git commit -a -m repeat | ||
' | ||
|
||
test_expect_success 'turn on bitmaps in the parent' ' | ||
git repack -adb | ||
' | ||
|
||
test_expect_success 'shallow fetch from bitmapped repo' ' | ||
(cd shallow.git && git fetch) | ||
' | ||
|
||
test_done |