Skip to content

Commit

Permalink
tests: git: allow file protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
rhubert committed Dec 31, 2024
1 parent 5acf1c0 commit f0cfa1c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion test/black-box/git-scm-switch/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ git add test.txt
git commit -m "initial commit"
git tag -a -m "Tag0" tag0
d1_c0=$(git rev-parse HEAD)
git submodule add "$git_submod" submod
git -c protocol.file.allow=always submodule add "$git_submod" submod
git commit -m "first commit"
git tag -a -m "First Tag" tag1
git checkout -b foobar
Expand Down
9 changes: 6 additions & 3 deletions test/unit/test_input_gitscm.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ def setUpClass(cls):
with tempfile.TemporaryDirectory() as tmp:
cmds = "\n".join([
'git init .',
'git config --local protocol.file.allow always',
'git config user.email "[email protected]"',
'git config user.name test',
'git checkout -b master',
Expand Down Expand Up @@ -537,7 +538,8 @@ def setUp(self):
echo 1 > test.txt
git add test.txt
mkdir -p some/deep
git submodule add --name whatever ../subsub1 some/deep/path
git -c protocol.file.allow=always \
submodule add --name whatever ../subsub1 some/deep/path
git commit -m "commit 1"
echo 2 > test.txt
git commit -a -m "commit 2"
Expand All @@ -551,7 +553,8 @@ def setUp(self):
git config user.name test
echo 1 > test.txt
git add test.txt
git submodule add ../sub1
git -c protocol.file.allow=always \
submodule add ../sub1
git commit -m "commit 1"
git tag -a -m 'Tag 1' tag1
cd ..
Expand Down Expand Up @@ -633,7 +636,7 @@ def addSub2(self):
cd ..
cd main
git submodule add ../sub2
git -c protocol.file.allow=always submodule add ../sub2
git commit -m "commit 2"
cd ..
"""
Expand Down
13 changes: 7 additions & 6 deletions test/unit/test_input_gitscm_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ def setUpClass(cls):
echo sub > test.txt
git add test.txt
mkdir -p some/deep
git submodule add --name whatever ../subsub some/deep/path
git -c protocol.file.allow=always \
submodule add --name whatever ../subsub some/deep/path
git commit -m import
cd ..
Expand All @@ -211,8 +212,8 @@ def setUpClass(cls):
git config user.name test
echo main > test.txt
git add test.txt
git submodule add ../sub
git submodule add ../sub2
git -c protocol.file.allow=always submodule add ../sub
git -c protocol.file.allow=always submodule add ../sub2
git commit -m import
cd ..
"""
Expand Down Expand Up @@ -393,7 +394,7 @@ def testUnexpectedSubmodule(self):
self.invokeGit(scm)

cmd = """\
git submodule update --init
git -c protocol.file.allow=always submodule update --init
"""
subprocess.check_call([getBashPath(), "-c", cmd], cwd=self.workspace)

Expand All @@ -410,7 +411,7 @@ def testUnexpectedSubSubModule(self):

cmd = """\
cd sub
git submodule update --init
git -c protocol.file.allow=always submodule update --init
"""
subprocess.check_call([getBashPath(), "-c", cmd], cwd=self.workspace)

Expand Down Expand Up @@ -468,7 +469,7 @@ def testSpecificUnexpectedSubmodule(self):
self.invokeGit(scm)

cmd = """\
git submodule update --init sub
git -c protocol.file.allow=always submodule update --init sub
"""
subprocess.check_call([getBashPath(), "-c", cmd], cwd=self.workspace)

Expand Down

0 comments on commit f0cfa1c

Please sign in to comment.