FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
GitPython/test/fixtures/env_case.py at main · gitpython-developers/GitPython · GitHub
gitpython-developers
GitPython
Repository navigation
Code
Issues
6
(6)
Pull requests
2
(2)
Discussions
Actions
Security and quality
41
(41)
Insights
Expand file tree
Breadcrumbs
GitPython
/
test
/
fixtures
/
env_case.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
18 lines (12 loc) · 696 Bytes
Breadcrumbs
GitPython
/
test
/
fixtures
/
env_case.py
Copy path
File metadata and controls
18 lines (12 loc) · 696 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
"""Steps 3 and 4 for test_it_avoids_upcasing_unrelated_environment_variable_names."""
import
subprocess
import
sys
# Step 3a: Import the module, in case that upcases the environment variable name.
import
git
_
,
working_dir
,
env_var_name
=
sys
.
argv
# Step 3b: Use Git.execute explicitly, in case that upcases the environment variable.
# (Importing git should be enough, but this ensures Git.execute is called.)
repo
=
git
.
Repo
(
working_dir
)
# Hold the reference.
git
.
Git
(
repo
.
working_dir
).
execute
([
"git"
,
"version"
])
# Step 4: Create the non-Python grandchild that accesses the variable case-sensitively.
print
(
subprocess
.
check_output
([
"set"
,
env_var_name
],
shell
=
True
,
text
=
True
))
Back
|
FazBrowse Home
|
New Git URL