forked from git/git
-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
core.fsyncmethod: tests for batch mode
Add test cases to exercise batch mode for: * 'git add' * 'git stash' * 'git update-index' * 'git unpack-objects' These tests ensure that the added data winds up in the object database. In this change we introduce a new test helper lib-unique-files.sh. The goal of this library is to create a tree of files that have different oids from any other files that may have been created in the current test repo. This helps us avoid missing validation of an object being added due to it already being in the repo. Signed-off-by: Neeraj Singh <neerajsi@microsoft.com>
- Loading branch information
1 parent
5c2e790
commit 35f0232
Showing
4 changed files
with
95 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Helper to create files with unique contents | ||
|
||
|
||
# Create multiple files with unique contents. Takes the number of | ||
# directories, the number of files in each directory, and the base | ||
# directory. | ||
# | ||
# test_create_unique_files 2 3 my_dir -- Creates 2 directories with 3 files | ||
# each in my_dir, all with unique | ||
# contents. | ||
|
||
test_create_unique_files() { | ||
test "$#" -ne 3 && BUG "3 param" | ||
|
||
local dirs=$1 | ||
local files=$2 | ||
local basedir=$3 | ||
local counter=0 | ||
test_tick | ||
local basedata=$test_tick | ||
|
||
|
||
rm -rf $basedir | ||
|
||
for i in $(test_seq $dirs) | ||
do | ||
local dir=$basedir/dir$i | ||
|
||
mkdir -p "$dir" | ||
for j in $(test_seq $files) | ||
do | ||
counter=$((counter + 1)) | ||
echo "$basedata.$counter" >"$dir/file$j.txt" | ||
done | ||
done | ||
} |
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