forked from git-for-windows/git
-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gvfs: optionally skip reachability checks/upload pack during fetch
While performing a fetch with a virtual file system we know that there will be missing objects and we don't want to download them just because of the reachability of the commits. We also don't want to download a pack file with commits, trees, and blobs since these will be downloaded on demand. This flag will skip the first connectivity check and by returning zero will skip the upload pack. It will also skip the second connectivity check but continue to update the branches to the latest commit ids. Signed-off-by: Kevin Willford <kewillf@microsoft.com>
- Loading branch information
Showing
4 changed files
with
53 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
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,24 @@ | ||
#!/bin/sh | ||
|
||
test_description='fetch using the flag to skip reachability and upload pack' | ||
|
||
. ./test-lib.sh | ||
|
||
|
||
test_expect_success setup ' | ||
echo inital >a && | ||
git add a && | ||
git commit -m initial && | ||
git clone . one | ||
' | ||
|
||
test_expect_success "fetch test" ' | ||
cd one && | ||
git config core.gvfs 16 && | ||
rm -rf .git/objects/* && | ||
git -C .. cat-file commit HEAD | git hash-object -w --stdin -t commit && | ||
git fetch && | ||
test_must_fail git rev-parse --verify HEAD^{tree} | ||
' | ||
|
||
test_done |