-
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove ".git" after cloning, with option to disable (#1463)
* Remove ".git" after cloning, with option to disable Also make clones shallow (they already were for pins) * Fix test
- Loading branch information
Showing
10 changed files
with
103 additions
and
9 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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,43 @@ | ||
""" | ||
Verify the proper "ungitting" of git origins | ||
""" | ||
|
||
import os | ||
import shutil | ||
|
||
from drivers.alr import alr_with, crate_dirname, init_local_crate, run_alr | ||
from drivers.asserts import assert_file_exists | ||
|
||
# By default, git deployments are shallow and see their .git directory removed | ||
# Check that and that enabling legacy behavior works | ||
|
||
cwd = os.getcwd() | ||
foo_dir = crate_dirname("libfoo") | ||
|
||
# By default .git should not be there | ||
for wanted in [False, True]: | ||
run_alr("get", "libfoo") | ||
|
||
# Check root gotten crate | ||
assert_file_exists(os.path.join(foo_dir, ".git"), | ||
wanted=wanted) | ||
|
||
# Check as dependency | ||
init_local_crate() | ||
alr_with("libfoo") | ||
|
||
assert_file_exists(os.path.join("alire", "cache", "dependencies", | ||
foo_dir, ".git"), | ||
wanted=wanted) | ||
|
||
if not wanted: | ||
# Enable for next round | ||
run_alr("config", "--global", "--set", | ||
"dependencies.git.keep_repository", "true") | ||
|
||
# Cleanup for next round | ||
os.chdir(cwd) | ||
shutil.rmtree(crate_dirname("libfoo")) | ||
shutil.rmtree("xxx") | ||
|
||
print('SUCCESS') |
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,3 @@ | ||
driver: python-script | ||
indexes: | ||
git_index: {} |