2015-07-30 02:37:31 +00:00
|
|
|
#!/usr/bin/env bash
|
2015-05-26 17:48:24 +00:00
|
|
|
|
|
|
|
. "test/testlib.sh"
|
|
|
|
|
2015-09-23 20:02:22 +00:00
|
|
|
envInitConfig='git config filter.lfs.smudge = "git-lfs smudge %f"
|
|
|
|
git config filter.lfs.clean = "git-lfs clean %f"'
|
|
|
|
|
2015-05-26 17:48:24 +00:00
|
|
|
begin_test "env with no remote"
|
|
|
|
(
|
|
|
|
set -e
|
|
|
|
reponame="env-no-remote"
|
|
|
|
mkdir $reponame
|
|
|
|
cd $reponame
|
|
|
|
git init
|
|
|
|
|
2015-10-16 12:28:34 +00:00
|
|
|
localwd=$(native_path "$TRASHDIR/$reponame")
|
|
|
|
localgit=$(native_path "$TRASHDIR/$reponame/.git")
|
|
|
|
localgitstore=$(native_path "$TRASHDIR/$reponame/.git")
|
|
|
|
localmedia=$(native_path "$TRASHDIR/$reponame/.git/lfs/objects")
|
|
|
|
tempdir=$(native_path "$TRASHDIR/$reponame/.git/lfs/tmp")
|
2015-10-20 16:24:04 +00:00
|
|
|
envVars=$(printf "%s" "$(env | grep "^GIT")")
|
2015-10-16 12:28:34 +00:00
|
|
|
|
|
|
|
expected=$(printf '%s
|
|
|
|
%s
|
|
|
|
|
|
|
|
LocalWorkingDir=%s
|
|
|
|
LocalGitDir=%s
|
|
|
|
LocalGitStorageDir=%s
|
|
|
|
LocalMediaDir=%s
|
|
|
|
TempDir=%s
|
2015-05-27 20:09:58 +00:00
|
|
|
ConcurrentTransfers=3
|
2015-09-01 20:31:51 +00:00
|
|
|
BatchTransfer=true
|
2015-10-21 09:58:18 +00:00
|
|
|
%s
|
|
|
|
%s
|
2015-10-20 16:24:04 +00:00
|
|
|
' "$(git lfs version)" "$(git version)" "$localwd" "$localgit" "$localgitstore" "$localmedia" "$tempdir" "$envVars" "$envInitConfig")
|
2015-05-26 17:48:24 +00:00
|
|
|
actual=$(git lfs env)
|
2015-10-21 09:58:18 +00:00
|
|
|
|
|
|
|
contains_same_elements "$expected" "$actual"
|
2015-05-26 17:48:24 +00:00
|
|
|
)
|
|
|
|
end_test
|
|
|
|
|
|
|
|
begin_test "env with origin remote"
|
|
|
|
(
|
|
|
|
set -e
|
|
|
|
reponame="env-origin-remote"
|
|
|
|
mkdir $reponame
|
|
|
|
cd $reponame
|
|
|
|
git init
|
|
|
|
git remote add origin "$GITSERVER/env-origin-remote"
|
|
|
|
|
2015-10-16 13:16:52 +00:00
|
|
|
endpoint="$GITSERVER/$reponame.git/info/lfs (auth=none)"
|
|
|
|
localwd=$(native_path "$TRASHDIR/$reponame")
|
|
|
|
localgit=$(native_path "$TRASHDIR/$reponame/.git")
|
|
|
|
localgitstore=$(native_path "$TRASHDIR/$reponame/.git")
|
|
|
|
localmedia=$(native_path "$TRASHDIR/$reponame/.git/lfs/objects")
|
|
|
|
tempdir=$(native_path "$TRASHDIR/$reponame/.git/lfs/tmp")
|
2015-10-20 16:24:04 +00:00
|
|
|
envVars=$(printf "%s" "$(env | grep "^GIT")")
|
2015-10-16 13:16:52 +00:00
|
|
|
expected=$(printf '%s
|
|
|
|
%s
|
|
|
|
|
|
|
|
Endpoint=%s
|
|
|
|
LocalWorkingDir=%s
|
|
|
|
LocalGitDir=%s
|
|
|
|
LocalGitStorageDir=%s
|
|
|
|
LocalMediaDir=%s
|
|
|
|
TempDir=%s
|
2015-05-27 20:09:58 +00:00
|
|
|
ConcurrentTransfers=3
|
2015-09-01 20:31:51 +00:00
|
|
|
BatchTransfer=true
|
2015-10-21 09:58:18 +00:00
|
|
|
%s
|
|
|
|
%s
|
2015-10-20 16:24:04 +00:00
|
|
|
' "$(git lfs version)" "$(git version)" "$endpoint" "$localwd" "$localgit" "$localgitstore" "$localmedia" "$tempdir" "$envVars" "$envInitConfig")
|
2015-05-26 17:48:24 +00:00
|
|
|
actual=$(git lfs env)
|
2015-10-21 09:58:18 +00:00
|
|
|
contains_same_elements "$expected" "$actual"
|
2015-05-26 17:48:24 +00:00
|
|
|
|
|
|
|
cd .git
|
2015-06-01 18:48:39 +00:00
|
|
|
expected2=$(echo "$expected" | sed -e 's/LocalWorkingDir=.*/LocalWorkingDir=/')
|
|
|
|
actual2=$(git lfs env)
|
2015-10-21 09:58:18 +00:00
|
|
|
contains_same_elements "$expected2" "$actual2"
|
2015-05-26 17:48:24 +00:00
|
|
|
)
|
|
|
|
end_test
|
|
|
|
|
|
|
|
begin_test "env with multiple remotes"
|
|
|
|
(
|
|
|
|
set -e
|
|
|
|
reponame="env-multiple-remotes"
|
|
|
|
mkdir $reponame
|
|
|
|
cd $reponame
|
|
|
|
git init
|
|
|
|
git remote add origin "$GITSERVER/env-origin-remote"
|
|
|
|
git remote add other "$GITSERVER/env-other-remote"
|
|
|
|
|
2015-10-16 14:35:47 +00:00
|
|
|
endpoint="$GITSERVER/env-origin-remote.git/info/lfs (auth=none)"
|
|
|
|
endpoint2="$GITSERVER/env-other-remote.git/info/lfs (auth=none)"
|
|
|
|
localwd=$(native_path "$TRASHDIR/$reponame")
|
|
|
|
localgit=$(native_path "$TRASHDIR/$reponame/.git")
|
|
|
|
localgitstore=$(native_path "$TRASHDIR/$reponame/.git")
|
|
|
|
localmedia=$(native_path "$TRASHDIR/$reponame/.git/lfs/objects")
|
|
|
|
tempdir=$(native_path "$TRASHDIR/$reponame/.git/lfs/tmp")
|
2015-10-20 16:24:04 +00:00
|
|
|
envVars=$(printf "%s" "$(env | grep "^GIT")")
|
2015-10-16 14:35:47 +00:00
|
|
|
expected=$(printf '%s
|
|
|
|
%s
|
|
|
|
|
|
|
|
Endpoint=%s
|
|
|
|
Endpoint (other)=%s
|
|
|
|
LocalWorkingDir=%s
|
|
|
|
LocalGitDir=%s
|
|
|
|
LocalGitStorageDir=%s
|
|
|
|
LocalMediaDir=%s
|
|
|
|
TempDir=%s
|
2015-05-27 20:09:58 +00:00
|
|
|
ConcurrentTransfers=3
|
2015-09-01 20:31:51 +00:00
|
|
|
BatchTransfer=true
|
2015-10-21 09:58:18 +00:00
|
|
|
%s
|
|
|
|
%s
|
2015-10-20 16:24:04 +00:00
|
|
|
' "$(git lfs version)" "$(git version)" "$endpoint" "$endpoint2" "$localwd" "$localgit" "$localgitstore" "$localmedia" "$tempdir" "$envVars" "$envInitConfig")
|
2015-05-26 17:48:24 +00:00
|
|
|
actual=$(git lfs env)
|
2015-10-21 09:58:18 +00:00
|
|
|
contains_same_elements "$expected" "$actual"
|
2015-05-26 17:48:24 +00:00
|
|
|
|
|
|
|
cd .git
|
2015-06-01 18:48:39 +00:00
|
|
|
expected2=$(echo "$expected" | sed -e 's/LocalWorkingDir=.*/LocalWorkingDir=/')
|
|
|
|
actual2=$(git lfs env)
|
2015-10-21 09:58:18 +00:00
|
|
|
contains_same_elements "$expected2" "$actual2"
|
2015-05-26 17:48:24 +00:00
|
|
|
)
|
|
|
|
end_test
|
|
|
|
|
|
|
|
begin_test "env with other remote"
|
|
|
|
(
|
|
|
|
set -e
|
|
|
|
reponame="env-other-remote"
|
|
|
|
mkdir $reponame
|
|
|
|
cd $reponame
|
|
|
|
git init
|
|
|
|
git remote add other "$GITSERVER/env-other-remote"
|
|
|
|
|
2015-10-16 15:31:40 +00:00
|
|
|
endpoint="$GITSERVER/env-other-remote.git/info/lfs (auth=none)"
|
|
|
|
localwd=$(native_path "$TRASHDIR/$reponame")
|
|
|
|
localgit=$(native_path "$TRASHDIR/$reponame/.git")
|
|
|
|
localgitstore=$(native_path "$TRASHDIR/$reponame/.git")
|
|
|
|
localmedia=$(native_path "$TRASHDIR/$reponame/.git/lfs/objects")
|
|
|
|
tempdir=$(native_path "$TRASHDIR/$reponame/.git/lfs/tmp")
|
2015-10-20 16:24:04 +00:00
|
|
|
envVars=$(printf "%s" "$(env | grep "^GIT")")
|
2015-10-16 15:31:40 +00:00
|
|
|
|
|
|
|
expected=$(printf '%s
|
|
|
|
%s
|
|
|
|
|
|
|
|
Endpoint (other)=%s
|
|
|
|
LocalWorkingDir=%s
|
|
|
|
LocalGitDir=%s
|
|
|
|
LocalGitStorageDir=%s
|
|
|
|
LocalMediaDir=%s
|
|
|
|
TempDir=%s
|
2015-05-27 20:09:58 +00:00
|
|
|
ConcurrentTransfers=3
|
2015-09-01 20:31:51 +00:00
|
|
|
BatchTransfer=true
|
2015-10-21 09:58:18 +00:00
|
|
|
%s
|
|
|
|
%s
|
2015-10-20 16:24:04 +00:00
|
|
|
' "$(git lfs version)" "$(git version)" "$endpoint" "$localwd" "$localgit" "$localgitstore" "$localmedia" "$tempdir" "$envVars" "$envInitConfig")
|
2015-05-26 17:48:24 +00:00
|
|
|
actual=$(git lfs env)
|
2015-10-21 09:58:18 +00:00
|
|
|
contains_same_elements "$expected" "$actual"
|
2015-05-26 17:48:24 +00:00
|
|
|
|
|
|
|
cd .git
|
2015-06-01 18:48:39 +00:00
|
|
|
expected2=$(echo "$expected" | sed -e 's/LocalWorkingDir=.*/LocalWorkingDir=/')
|
|
|
|
actual2=$(git lfs env)
|
2015-10-21 09:58:18 +00:00
|
|
|
contains_same_elements "$expected2" "$actual2"
|
2015-05-26 17:48:24 +00:00
|
|
|
)
|
|
|
|
end_test
|
|
|
|
|
|
|
|
begin_test "env with multiple remotes and lfs.url config"
|
|
|
|
(
|
|
|
|
set -e
|
|
|
|
reponame="env-multiple-remotes-with-lfs-url"
|
|
|
|
mkdir $reponame
|
|
|
|
cd $reponame
|
|
|
|
git init
|
|
|
|
git remote add origin "$GITSERVER/env-origin-remote"
|
|
|
|
git remote add other "$GITSERVER/env-other-remote"
|
|
|
|
git config lfs.url "http://foo/bar"
|
|
|
|
|
2015-10-16 15:31:40 +00:00
|
|
|
endpoint="$GITSERVER/env-other-remote.git/info/lfs (auth=none)"
|
|
|
|
localwd=$(native_path "$TRASHDIR/$reponame")
|
|
|
|
localgit=$(native_path "$TRASHDIR/$reponame/.git")
|
|
|
|
localgitstore=$(native_path "$TRASHDIR/$reponame/.git")
|
|
|
|
localmedia=$(native_path "$TRASHDIR/$reponame/.git/lfs/objects")
|
|
|
|
tempdir=$(native_path "$TRASHDIR/$reponame/.git/lfs/tmp")
|
2015-10-20 16:24:04 +00:00
|
|
|
envVars=$(printf "%s" "$(env | grep "^GIT")")
|
2015-10-16 15:31:40 +00:00
|
|
|
expected=$(printf '%s
|
|
|
|
%s
|
|
|
|
|
2015-09-01 21:54:31 +00:00
|
|
|
Endpoint=http://foo/bar (auth=none)
|
2015-10-16 15:31:40 +00:00
|
|
|
Endpoint (other)=%s
|
|
|
|
LocalWorkingDir=%s
|
|
|
|
LocalGitDir=%s
|
|
|
|
LocalGitStorageDir=%s
|
|
|
|
LocalMediaDir=%s
|
|
|
|
TempDir=%s
|
2015-05-27 20:09:58 +00:00
|
|
|
ConcurrentTransfers=3
|
2015-09-01 20:31:51 +00:00
|
|
|
BatchTransfer=true
|
2015-10-21 09:58:18 +00:00
|
|
|
%s
|
|
|
|
%s
|
2015-10-20 16:24:04 +00:00
|
|
|
' "$(git lfs version)" "$(git version)" "$endpoint" "$localwd" "$localgit" "$localgitstore" "$localmedia" "$tempdir" "$envVars" "$envInitConfig")
|
2015-05-26 17:48:24 +00:00
|
|
|
actual=$(git lfs env)
|
2015-10-21 09:58:18 +00:00
|
|
|
contains_same_elements "$expected" "$actual"
|
2015-05-26 17:48:24 +00:00
|
|
|
|
|
|
|
cd .git
|
2015-06-01 18:48:39 +00:00
|
|
|
expected2=$(echo "$expected" | sed -e 's/LocalWorkingDir=.*/LocalWorkingDir=/')
|
|
|
|
actual2=$(git lfs env)
|
2015-10-21 09:58:18 +00:00
|
|
|
contains_same_elements "$expected2" "$actual2"
|
2015-05-26 17:48:24 +00:00
|
|
|
)
|
|
|
|
end_test
|
|
|
|
|
|
|
|
begin_test "env with multiple remotes and lfs configs"
|
|
|
|
(
|
|
|
|
set -e
|
|
|
|
reponame="env-multiple-remotes-lfs-configs"
|
|
|
|
mkdir $reponame
|
|
|
|
cd $reponame
|
|
|
|
git init
|
|
|
|
git remote add origin "$GITSERVER/env-origin-remote"
|
|
|
|
git remote add other "$GITSERVER/env-other-remote"
|
|
|
|
git config lfs.url "http://foo/bar"
|
|
|
|
git config remote.origin.lfsurl "http://custom/origin"
|
|
|
|
git config remote.other.lfsurl "http://custom/other"
|
|
|
|
|
2015-10-16 15:31:40 +00:00
|
|
|
localwd=$(native_path "$TRASHDIR/$reponame")
|
|
|
|
localgit=$(native_path "$TRASHDIR/$reponame/.git")
|
|
|
|
localgitstore=$(native_path "$TRASHDIR/$reponame/.git")
|
|
|
|
localmedia=$(native_path "$TRASHDIR/$reponame/.git/lfs/objects")
|
|
|
|
tempdir=$(native_path "$TRASHDIR/$reponame/.git/lfs/tmp")
|
2015-10-20 16:24:04 +00:00
|
|
|
envVars=$(printf "%s" "$(env | grep "^GIT")")
|
2015-10-16 15:31:40 +00:00
|
|
|
expected=$(printf '%s
|
|
|
|
%s
|
|
|
|
|
2015-09-01 21:54:31 +00:00
|
|
|
Endpoint=http://foo/bar (auth=none)
|
|
|
|
Endpoint (other)=http://custom/other (auth=none)
|
2015-10-16 15:31:40 +00:00
|
|
|
LocalWorkingDir=%s
|
|
|
|
LocalGitDir=%s
|
|
|
|
LocalGitStorageDir=%s
|
|
|
|
LocalMediaDir=%s
|
|
|
|
TempDir=%s
|
2015-05-27 20:09:58 +00:00
|
|
|
ConcurrentTransfers=3
|
2015-09-01 20:31:51 +00:00
|
|
|
BatchTransfer=true
|
2015-10-21 09:58:18 +00:00
|
|
|
%s
|
|
|
|
%s
|
2015-10-20 16:24:04 +00:00
|
|
|
' "$(git lfs version)" "$(git version)" "$localwd" "$localgit" "$localgitstore" "$localmedia" "$tempdir" "$envVars" "$envInitConfig")
|
2015-05-27 20:09:58 +00:00
|
|
|
actual=$(git lfs env)
|
2015-10-21 09:58:18 +00:00
|
|
|
contains_same_elements "$expected" "$actual"
|
2015-05-27 20:09:58 +00:00
|
|
|
|
|
|
|
cd .git
|
2015-06-01 18:48:39 +00:00
|
|
|
expected2=$(echo "$expected" | sed -e 's/LocalWorkingDir=.*/LocalWorkingDir=/')
|
|
|
|
actual2=$(git lfs env)
|
|
|
|
[ "$expected2" = "$actual2" ]
|
2015-05-27 20:09:58 +00:00
|
|
|
)
|
|
|
|
end_test
|
|
|
|
|
|
|
|
begin_test "env with multiple remotes and lfs url and batch configs"
|
|
|
|
(
|
|
|
|
set -e
|
|
|
|
reponame="env-multiple-remotes-lfs-batch-configs"
|
|
|
|
mkdir $reponame
|
|
|
|
cd $reponame
|
|
|
|
git init
|
|
|
|
git remote add origin "$GITSERVER/env-origin-remote"
|
|
|
|
git remote add other "$GITSERVER/env-other-remote"
|
|
|
|
git config lfs.url "http://foo/bar"
|
2015-09-01 20:31:51 +00:00
|
|
|
git config lfs.batch false
|
2015-05-27 20:09:58 +00:00
|
|
|
git config lfs.concurrenttransfers 5
|
|
|
|
git config remote.origin.lfsurl "http://custom/origin"
|
|
|
|
git config remote.other.lfsurl "http://custom/other"
|
|
|
|
|
2015-10-16 15:31:40 +00:00
|
|
|
localwd=$(native_path "$TRASHDIR/$reponame")
|
|
|
|
localgit=$(native_path "$TRASHDIR/$reponame/.git")
|
|
|
|
localgitstore=$(native_path "$TRASHDIR/$reponame/.git")
|
|
|
|
localmedia=$(native_path "$TRASHDIR/$reponame/.git/lfs/objects")
|
|
|
|
tempdir=$(native_path "$TRASHDIR/$reponame/.git/lfs/tmp")
|
2015-10-20 16:24:04 +00:00
|
|
|
envVars=$(printf "%s" "$(env | grep "^GIT")")
|
2015-10-16 15:31:40 +00:00
|
|
|
expected=$(printf '%s
|
|
|
|
%s
|
|
|
|
|
2015-09-01 21:54:31 +00:00
|
|
|
Endpoint=http://foo/bar (auth=none)
|
|
|
|
Endpoint (other)=http://custom/other (auth=none)
|
2015-10-16 15:31:40 +00:00
|
|
|
LocalWorkingDir=%s
|
|
|
|
LocalGitDir=%s
|
|
|
|
LocalGitStorageDir=%s
|
|
|
|
LocalMediaDir=%s
|
|
|
|
TempDir=%s
|
2015-05-27 20:09:58 +00:00
|
|
|
ConcurrentTransfers=5
|
2015-09-01 20:31:51 +00:00
|
|
|
BatchTransfer=false
|
2015-10-21 09:58:18 +00:00
|
|
|
%s
|
|
|
|
%s
|
2015-10-20 16:24:04 +00:00
|
|
|
' "$(git lfs version)" "$(git version)" "$localwd" "$localgit" "$localgitstore" "$localmedia" "$tempdir" "$envVars" "$envInitConfig")
|
2015-05-26 17:48:24 +00:00
|
|
|
actual=$(git lfs env)
|
2015-10-21 09:58:18 +00:00
|
|
|
contains_same_elements "$expected" "$actual"
|
2015-05-26 17:48:24 +00:00
|
|
|
|
|
|
|
cd .git
|
2015-06-01 18:49:28 +00:00
|
|
|
expected2=$(echo "$expected" | sed -e 's/LocalWorkingDir=.*/LocalWorkingDir=/')
|
|
|
|
actual2=$(git lfs env)
|
2015-10-21 09:58:18 +00:00
|
|
|
contains_same_elements "$expected2" "$actual2"
|
2015-06-01 18:49:28 +00:00
|
|
|
)
|
|
|
|
end_test
|
|
|
|
|
|
|
|
begin_test "env with .gitconfig"
|
|
|
|
(
|
|
|
|
set -e
|
|
|
|
reponame="env-with-gitconfig"
|
|
|
|
|
|
|
|
git init $reponame
|
|
|
|
cd $reponame
|
2015-05-26 17:48:24 +00:00
|
|
|
|
2015-06-01 18:49:28 +00:00
|
|
|
git remote add origin "$GITSERVER/env-origin-remote"
|
|
|
|
echo '[remote "origin"]
|
|
|
|
lfsurl = http://foobar:8080/
|
|
|
|
[lfs]
|
2015-10-20 16:31:56 +00:00
|
|
|
batch = false
|
2015-06-01 18:49:28 +00:00
|
|
|
concurrenttransfers = 5
|
|
|
|
' > .gitconfig
|
|
|
|
|
2015-10-16 15:31:40 +00:00
|
|
|
localwd=$(native_path "$TRASHDIR/$reponame")
|
|
|
|
localgit=$(native_path "$TRASHDIR/$reponame/.git")
|
|
|
|
localgitstore=$(native_path "$TRASHDIR/$reponame/.git")
|
|
|
|
localmedia=$(native_path "$TRASHDIR/$reponame/.git/lfs/objects")
|
|
|
|
tempdir=$(native_path "$TRASHDIR/$reponame/.git/lfs/tmp")
|
2015-10-20 16:24:04 +00:00
|
|
|
envVars=$(printf "%s" "$(env | grep "^GIT")")
|
2015-10-16 15:31:40 +00:00
|
|
|
expected=$(printf '%s
|
|
|
|
%s
|
|
|
|
|
2015-09-01 21:54:31 +00:00
|
|
|
Endpoint=http://foobar:8080/ (auth=none)
|
2015-10-16 15:31:40 +00:00
|
|
|
LocalWorkingDir=%s
|
|
|
|
LocalGitDir=%s
|
|
|
|
LocalGitStorageDir=%s
|
|
|
|
LocalMediaDir=%s
|
|
|
|
TempDir=%s
|
2015-10-20 16:31:56 +00:00
|
|
|
ConcurrentTransfers=3
|
2015-06-01 18:49:28 +00:00
|
|
|
BatchTransfer=true
|
2015-10-21 09:58:18 +00:00
|
|
|
%s
|
|
|
|
%s
|
2015-10-20 16:24:04 +00:00
|
|
|
' "$(git lfs version)" "$(git version)" "$localwd" "$localgit" "$localgitstore" "$localmedia" "$tempdir" "$envVars" "$envInitConfig")
|
2015-06-01 18:49:28 +00:00
|
|
|
actual=$(git lfs env)
|
2015-10-21 09:58:18 +00:00
|
|
|
contains_same_elements "$expected" "$actual"
|
2015-06-01 18:49:28 +00:00
|
|
|
|
|
|
|
mkdir a
|
|
|
|
cd a
|
|
|
|
actual2=$(git lfs env)
|
2015-10-21 09:58:18 +00:00
|
|
|
contains_same_elements "$expected" "$actual2"
|
2015-05-26 17:48:24 +00:00
|
|
|
)
|
|
|
|
end_test
|
2015-06-06 12:30:54 +00:00
|
|
|
|
|
|
|
begin_test "env with environment variables"
|
|
|
|
(
|
|
|
|
set -e
|
|
|
|
reponame="env-with-envvars"
|
|
|
|
git init $reponame
|
|
|
|
mkdir -p $reponame/a/b/c
|
|
|
|
|
2015-10-16 15:31:40 +00:00
|
|
|
gitDir=$(native_path "$TRASHDIR/$reponame/.git")
|
|
|
|
workTree=$(native_path "$TRASHDIR/$reponame/a/b")
|
2015-06-06 12:30:54 +00:00
|
|
|
|
2015-10-16 15:31:40 +00:00
|
|
|
localwd=$(native_path "$TRASHDIR/$reponame/a/b")
|
|
|
|
localgit=$(native_path "$TRASHDIR/$reponame/.git")
|
|
|
|
localgitstore=$(native_path "$TRASHDIR/$reponame/.git")
|
|
|
|
localmedia=$(native_path "$TRASHDIR/$reponame/.git/lfs/objects")
|
|
|
|
tempdir=$(native_path "$TRASHDIR/$reponame/.git/lfs/tmp")
|
2015-10-20 16:24:04 +00:00
|
|
|
envVars="$(GIT_DIR=$gitDir GIT_WORK_TREE=$workTree env | grep "^GIT" | sort)"
|
2015-10-16 15:31:40 +00:00
|
|
|
expected=$(printf '%s
|
|
|
|
%s
|
|
|
|
|
|
|
|
LocalWorkingDir=%s
|
|
|
|
LocalGitDir=%s
|
|
|
|
LocalGitStorageDir=%s
|
|
|
|
LocalMediaDir=%s
|
|
|
|
TempDir=%s
|
2015-06-06 12:30:54 +00:00
|
|
|
ConcurrentTransfers=3
|
2015-09-01 20:31:51 +00:00
|
|
|
BatchTransfer=true
|
2015-09-23 20:02:22 +00:00
|
|
|
%s
|
2015-10-16 15:31:40 +00:00
|
|
|
%s
|
2015-10-20 16:24:04 +00:00
|
|
|
' "$(git lfs version)" "$(git version)" "$localwd" "$localgit" "$localgitstore" "$localmedia" "$tempdir" "$envVars" "$envInitConfig")
|
2015-06-06 12:30:54 +00:00
|
|
|
|
|
|
|
actual=$(GIT_DIR=$gitDir GIT_WORK_TREE=$workTree git lfs env)
|
2015-10-21 09:58:18 +00:00
|
|
|
contains_same_elements "$expected" "$actual"
|
2015-06-06 12:30:54 +00:00
|
|
|
|
|
|
|
cd $TRASHDIR/$reponame
|
|
|
|
actual2=$(GIT_DIR=$gitDir GIT_WORK_TREE=$workTree git lfs env)
|
2015-10-21 09:58:18 +00:00
|
|
|
contains_same_elements "$expected" "$actual2"
|
2015-06-06 12:30:54 +00:00
|
|
|
|
|
|
|
cd $TRASHDIR/$reponame/.git
|
|
|
|
actual3=$(GIT_DIR=$gitDir GIT_WORK_TREE=$workTree git lfs env)
|
2015-10-21 09:58:18 +00:00
|
|
|
contains_same_elements "$expected" "$actual3"
|
2015-06-06 12:30:54 +00:00
|
|
|
|
|
|
|
cd $TRASHDIR/$reponame/a/b/c
|
|
|
|
actual4=$(GIT_DIR=$gitDir GIT_WORK_TREE=$workTree git lfs env)
|
2015-10-21 09:58:18 +00:00
|
|
|
contains_same_elements "$expected" "$actual4"
|
2015-06-06 12:30:54 +00:00
|
|
|
|
2015-10-20 16:24:04 +00:00
|
|
|
envVars="$(GIT_DIR=$gitDir GIT_WORK_TREE=a/b env | grep "^GIT" | sort)"
|
2015-10-16 15:31:40 +00:00
|
|
|
expected5=$(printf '%s
|
|
|
|
%s
|
|
|
|
|
|
|
|
LocalWorkingDir=%s
|
|
|
|
LocalGitDir=%s
|
|
|
|
LocalGitStorageDir=%s
|
|
|
|
LocalMediaDir=%s
|
|
|
|
TempDir=%s
|
2015-06-06 12:30:54 +00:00
|
|
|
ConcurrentTransfers=3
|
2015-09-01 20:31:51 +00:00
|
|
|
BatchTransfer=true
|
2015-10-16 15:31:40 +00:00
|
|
|
%s
|
2015-09-23 20:02:22 +00:00
|
|
|
git config filter.lfs.smudge = \"\"
|
|
|
|
git config filter.lfs.clean = \"\"
|
2015-10-20 16:24:04 +00:00
|
|
|
' "$(git lfs version)" "$(git version)" "$localwd" "$localgit" "$localgitstore" "$localmedia" "$tempdir" "$envVars")
|
2015-06-06 12:30:54 +00:00
|
|
|
actual5=$(GIT_DIR=$gitDir GIT_WORK_TREE=a/b git lfs env)
|
2015-10-21 09:58:18 +00:00
|
|
|
contains_same_elements "$expected5" "$actual5"
|
2015-06-06 12:30:54 +00:00
|
|
|
|
|
|
|
cd $TRASHDIR/$reponame/a/b
|
2015-10-20 16:24:04 +00:00
|
|
|
envVars="$(GIT_DIR=$gitDir env | grep "^GIT" | sort)"
|
2015-10-16 15:31:40 +00:00
|
|
|
expected7=$(printf '%s
|
|
|
|
%s
|
|
|
|
|
|
|
|
LocalWorkingDir=%s
|
|
|
|
LocalGitDir=%s
|
|
|
|
LocalGitStorageDir=%s
|
|
|
|
LocalMediaDir=%s
|
|
|
|
TempDir=%s
|
2015-06-06 12:30:54 +00:00
|
|
|
ConcurrentTransfers=3
|
2015-09-01 20:31:51 +00:00
|
|
|
BatchTransfer=true
|
2015-09-23 20:02:22 +00:00
|
|
|
%s
|
2015-10-16 15:31:40 +00:00
|
|
|
%s
|
2015-10-20 16:24:04 +00:00
|
|
|
' "$(git lfs version)" "$(git version)" "$localwd" "$localgit" "$localgitstore" "$localmedia" "$tempdir" "$envVars" "$envInitConfig")
|
2015-06-06 12:30:54 +00:00
|
|
|
actual7=$(GIT_DIR=$gitDir git lfs env)
|
2015-10-21 09:58:18 +00:00
|
|
|
contains_same_elements "$expected7" "$actual7"
|
2015-06-06 12:30:54 +00:00
|
|
|
|
|
|
|
cd $TRASHDIR/$reponame/a
|
2015-10-20 16:24:04 +00:00
|
|
|
envVars="$(GIT_WORK_TREE=$workTree env | grep "^GIT" | sort)"
|
2015-10-16 15:31:40 +00:00
|
|
|
expected8=$(printf '%s
|
|
|
|
%s
|
|
|
|
|
|
|
|
LocalWorkingDir=%s
|
|
|
|
LocalGitDir=%s
|
|
|
|
LocalGitStorageDir=%s
|
|
|
|
LocalMediaDir=%s
|
|
|
|
TempDir=%s
|
2015-06-06 12:30:54 +00:00
|
|
|
ConcurrentTransfers=3
|
2015-09-01 20:31:51 +00:00
|
|
|
BatchTransfer=true
|
2015-09-23 20:02:22 +00:00
|
|
|
%s
|
2015-10-16 15:31:40 +00:00
|
|
|
%s
|
2015-10-20 16:24:04 +00:00
|
|
|
' "$(git lfs version)" "$(git version)" "$localwd" "$localgit" "$localgitstore" "$localmedia" "$tempdir" "$envVars" "$envInitConfig")
|
2015-06-06 12:30:54 +00:00
|
|
|
actual8=$(GIT_WORK_TREE=$workTree git lfs env)
|
2015-10-21 09:58:18 +00:00
|
|
|
contains_same_elements "$expected8" "$actual8"
|
2015-06-06 12:30:54 +00:00
|
|
|
)
|
|
|
|
end_test
|
2015-09-30 22:16:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
begin_test "env with bare repo"
|
|
|
|
(
|
|
|
|
set -e
|
|
|
|
reponame="env-with-bare-repo"
|
|
|
|
git init --bare $reponame
|
|
|
|
cd $reponame
|
|
|
|
|
2015-10-16 15:31:40 +00:00
|
|
|
localgit=$(native_path "$TRASHDIR/$reponame")
|
|
|
|
localgitstore=$(native_path "$TRASHDIR/$reponame")
|
|
|
|
localmedia=$(native_path "$TRASHDIR/$reponame/lfs/objects")
|
|
|
|
tempdir=$(native_path "$TRASHDIR/$reponame/lfs/tmp")
|
|
|
|
env="$(env | grep "^GIT")"
|
|
|
|
|
2015-09-30 22:16:14 +00:00
|
|
|
expected=$(printf "%s\n%s\n
|
|
|
|
LocalWorkingDir=
|
2015-10-16 15:31:40 +00:00
|
|
|
LocalGitDir=%s
|
|
|
|
LocalGitStorageDir=%s
|
|
|
|
LocalMediaDir=%s
|
|
|
|
TempDir=%s
|
2015-09-30 22:16:14 +00:00
|
|
|
ConcurrentTransfers=3
|
|
|
|
BatchTransfer=true
|
|
|
|
%s
|
2015-10-16 15:31:40 +00:00
|
|
|
%s
|
|
|
|
" "$(git lfs version)" "$(git version)" "$localgit" "$localgitstore" "$localmedia" "$tempdir" "$env" "$envInitConfig")
|
2015-09-30 22:16:14 +00:00
|
|
|
actual=$(git lfs env)
|
|
|
|
[ "$expected" = "$actual" ]
|
|
|
|
|
|
|
|
)
|
|
|
|
end_test
|