Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4d9b7b0

Browse files
committed
Merge branch 'igetgames-feature/0.3/git-file-support' into 0.3
Resolvesgitpython-developers#89
2 parentsd48ed95 +7ea7828 commit4d9b7b0

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

‎git/test/fixtures/git_file

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
gitdir: ./.real

‎git/test/test_repo.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424

2525

2626
classTestRepo(TestBase):
27-
2827
@raises(InvalidGitRepositoryError)
2928
deftest_new_should_raise_on_invalid_repo_location(self):
3029
Repo(tempfile.gettempdir())
@@ -615,3 +614,20 @@ def test_submodule_update(self, rwrepo):
615614
assertisinstance(sm,Submodule)
616615

617616
# note: the rest of this functionality is tested in test_submodule
617+
618+
@with_rw_repo('HEAD')
619+
deftest_git_file(self,rwrepo):
620+
# Move the .git directory to another location and create the .git file.
621+
real_path_abs=os.path.abspath(join_path_native(rwrepo.working_tree_dir,'.real'))
622+
os.rename(rwrepo.git_dir,real_path_abs)
623+
git_file_path=join_path_native(rwrepo.working_tree_dir,'.git')
624+
open(git_file_path,'wb').write(fixture('git_file'))
625+
626+
# Create a repo and make sure it's pointing to the relocated .git directory.
627+
git_file_repo=Repo(rwrepo.working_tree_dir)
628+
assertos.path.abspath(git_file_repo.git_dir)==real_path_abs
629+
630+
# Test using an absolute gitdir path in the .git file.
631+
open(git_file_path,'wb').write('gitdir: %s\n'%real_path_abs)
632+
git_file_repo=Repo(rwrepo.working_tree_dir)
633+
assertos.path.abspath(git_file_repo.git_dir)==real_path_abs

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp