diff options
| author | Jiang Xin <worldhello.net@gmail.com> | 2023-08-16 07:24:56 +0800 |
|---|---|---|
| committer | Jiang Xin <worldhello.net@gmail.com> | 2023-08-16 07:24:56 +0800 |
| commit | 62a26b36bd9bf76feb6940e2bee732bd62b429f8 (patch) | |
| tree | 3500be70c7d872566578e3fa324f1a8d1fe796e7 /t/lib-commit-graph.sh | |
| parent | 450f2c9e3e461e4785643730f9c82eb9a64faddd (diff) | |
| parent | f1ed9d7dc0e49dc1a044941d821c9d2342313c26 (diff) | |
| download | git-62a26b36bd9bf76feb6940e2bee732bd62b429f8.tar.gz | |
Merge branch 'master' of github.com:git/git
* 'master' of github.com:git/git: (34 commits)
Git 2.42-rc2
t4053: avoid writing to unopened pipe
t4053: avoid race when killing background processes
Git 2.42-rc1
git maintenance: avoid console window in scheduled tasks on Windows
win32: add a helper to run `git.exe` without a foreground window
t9001: remove excessive GIT_SEND_EMAIL_NOTTY=1
mv: handle lstat() failure correctly
parse-options: disallow negating OPTION_SET_INT 0
repack: free geometry struct
send-email: avoid creating more than one Term::ReadLine object
send-email: drop FakeTerm hack
t0040: declare non-tab indentation to be okay in this script
advice: handle "rebase" in error_resolve_conflict()
A few more topics before -rc1
mailmap: change primary address for Glen Choo
gitignore: ignore clangd .cache directory
docs: update when `git bisect visualize` uses `gitk`
compat/mingw: implement a native locate_in_PATH()
run-command: conditionally define locate_in_PATH()
...
Diffstat (limited to 't/lib-commit-graph.sh')
| -rwxr-xr-x | t/lib-commit-graph.sh | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/t/lib-commit-graph.sh b/t/lib-commit-graph.sh index 5d79e1a4e9..89b26676fb 100755 --- a/t/lib-commit-graph.sh +++ b/t/lib-commit-graph.sh @@ -14,24 +14,37 @@ graph_git_two_modes() { test_cmp expect output } +# graph_git_behavior <name> <directory> <branch> <compare> +# +# Ensures that a handful of traversal operations produce the same +# results with and without the commit-graph in use. +# +# NOTE: it is a bug to call this function with <directory> containing +# any characters in $IFS. graph_git_behavior() { MSG=$1 DIR=$2 BRANCH=$3 COMPARE=$4 test_expect_success "check normal git operations: $MSG" ' - cd "$TRASH_DIRECTORY/$DIR" && - graph_git_two_modes "log --oneline $BRANCH" && - graph_git_two_modes "log --topo-order $BRANCH" && - graph_git_two_modes "log --graph $COMPARE..$BRANCH" && - graph_git_two_modes "branch -vv" && - graph_git_two_modes "merge-base -a $BRANCH $COMPARE" + graph_git_two_modes "${DIR:+-C $DIR} log --oneline $BRANCH" && + graph_git_two_modes "${DIR:+-C $DIR} log --topo-order $BRANCH" && + graph_git_two_modes "${DIR:+-C $DIR} log --graph $COMPARE..$BRANCH" && + graph_git_two_modes "${DIR:+-C $DIR} branch -vv" && + graph_git_two_modes "${DIR:+-C $DIR} merge-base -a $BRANCH $COMPARE" ' } graph_read_expect() { OPTIONAL="" NUM_CHUNKS=3 + DIR="." + if test "$1" = -C + then + shift + DIR="$1" + shift + fi if test -n "$2" then OPTIONAL=" $2" @@ -47,12 +60,15 @@ graph_read_expect() { then OPTIONS=" read_generation_data" fi - cat >expect <<- EOF + cat >"$DIR/expect" <<-EOF header: 43475048 1 $(test_oid oid_version) $NUM_CHUNKS 0 num_commits: $1 chunks: oid_fanout oid_lookup commit_metadata$OPTIONAL options:$OPTIONS EOF - test-tool read-graph >output && - test_cmp expect output + ( + cd "$DIR" && + test-tool read-graph >output && + test_cmp expect output + ) } |
