Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
all baseline test cases from git's test-suite (#450)
- Loading branch information
Showing
4 changed files
with
102 additions
and
1 deletion.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
git-refspec/tests/fixtures/generated-archives/make_baseline.tar.xz
Git LFS file not shown
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,91 @@ | ||
#!/bin/bash | ||
set -eu -o pipefail | ||
|
||
git init; | ||
|
||
function baseline() { | ||
local kind=$1 | ||
local refspec=$2 | ||
|
||
cat <<EOF >.git/config | ||
[remote "test"] | ||
url = . | ||
$kind = "$refspec" | ||
EOF | ||
|
||
git ls-remote "test" && status=0 || status=$? | ||
{ | ||
echo "$kind" "$refspec" | ||
echo "$status" | ||
} >> baseline.git | ||
} | ||
|
||
|
||
# invalid | ||
|
||
baseline push '' | ||
baseline push '::' | ||
baseline fetch '::' | ||
|
||
baseline push 'refs/heads/*:refs/remotes/frotz' | ||
baseline push 'refs/heads:refs/remotes/frotz/*' | ||
|
||
baseline fetch 'refs/heads/*:refs/remotes/frotz' | ||
baseline fetch 'refs/heads:refs/remotes/frotz/*' | ||
baseline fetch 'refs/heads/main::refs/remotes/frotz/xyzzy' | ||
baseline fetch 'refs/heads/maste :refs/remotes/frotz/xyzzy' | ||
baseline fetch 'main~1:refs/remotes/frotz/backup' | ||
baseline fetch 'HEAD~4:refs/remotes/frotz/new' | ||
baseline push 'refs/heads/ nitfol' | ||
baseline fetch 'refs/heads/ nitfol' | ||
baseline push 'HEAD:' | ||
baseline push 'refs/heads/ nitfol:' | ||
baseline fetch 'refs/heads/ nitfol:' | ||
baseline push ':refs/remotes/frotz/delete me' | ||
baseline fetch ':refs/remotes/frotz/HEAD to me' | ||
baseline fetch 'refs/heads/*/*/for-linus:refs/remotes/mine/*' | ||
baseline push 'refs/heads/*/*/for-linus:refs/remotes/mine/*' | ||
|
||
baseline fetch 'refs/heads/*g*/for-linus:refs/remotes/mine/*' | ||
baseline push 'refs/heads/*g*/for-linus:refs/remotes/mine/*' | ||
bad=$(printf '\011tab') | ||
baseline fetch "refs/heads/${bad}" | ||
|
||
# valid | ||
baseline push '+:' | ||
baseline push ':' | ||
|
||
baseline fetch '' | ||
baseline fetch ':' | ||
baseline push 'refs/heads/main:refs/remotes/frotz/xyzzy' | ||
baseline push 'refs/heads/*:refs/remotes/frotz/*' | ||
|
||
|
||
baseline fetch 'refs/heads/*:refs/remotes/frotz/*' | ||
baseline fetch 'refs/heads/main:refs/remotes/frotz/xyzzy' | ||
|
||
baseline push 'main~1:refs/remotes/frotz/backup' | ||
baseline push 'HEAD~4:refs/remotes/frotz/new' | ||
|
||
baseline push 'HEAD' | ||
baseline fetch 'HEAD' | ||
baseline push '@' | ||
baseline fetch '@' | ||
|
||
baseline fetch 'HEAD:' | ||
|
||
baseline push ':refs/remotes/frotz/deleteme' | ||
baseline fetch ':refs/remotes/frotz/HEAD-to-me' | ||
|
||
baseline fetch 'refs/heads/*/for-linus:refs/remotes/mine/*-blah' | ||
baseline push 'refs/heads/*/for-linus:refs/remotes/mine/*-blah' | ||
|
||
baseline fetch 'refs/heads*/for-linus:refs/remotes/mine/*' | ||
baseline push 'refs/heads*/for-linus:refs/remotes/mine/*' | ||
|
||
|
||
baseline fetch 'refs/heads/*/for-linus:refs/remotes/mine/*' | ||
baseline push 'refs/heads/*/for-linus:refs/remotes/mine/*' | ||
|
||
good=$(printf '\303\204') | ||
baseline fetch "refs/heads/${good}" |
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,7 @@ | ||
use git_testtools::scripted_fixture_repo_read_only; | ||
|
||
#[test] | ||
#[ignore] | ||
fn baseline() { | ||
let _dir = scripted_fixture_repo_read_only("make_baseline.sh").unwrap(); | ||
} |
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 |
---|---|---|
@@ -1 +1 @@ | ||
|
||
mod parse; |