Kiln » Dependencies » Dulwich Read More
Clone URL:  
Pushed to one repository · View In Graph Contained in master

add a test for "Do not crash when cloning HEAD-less repo" with empty.git test data

Conflicts:
dulwich/tests/test_repository.py

Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>

Changeset dfe7b678cfae

Parent 99274d9ddb15

committed by Jelmer Vernooij

authored by DeeKey

Changes to 7 files · Browse files at dfe7b678cfae Showing diff from parent 99274d9ddb15 Diff from another changeset...

Change 1 of 1 Show Entire File dulwich/​tests/​data/​repos/​empty.git/​HEAD Stacked
 
 
 
1
@@ -1,0 +1,1 @@
+ref: refs/heads/master
Change 1 of 1 Show Entire File dulwich/​tests/​data/​repos/​empty.git/​config Stacked
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
@@ -1,0 +1,7 @@
+[core] + repositoryformatversion = 0 + filemode = false + bare = true + symlinks = false + ignorecase = true + hideDotFiles = dotGitOnly
 
 
 
 
 
1
2
 
@@ -1,0 +1,2 @@
+* +!.gitignore \ No newline at end of file
 
 
 
 
 
1
2
 
@@ -1,0 +1,2 @@
+* +!.gitignore \ No newline at end of file
 
 
 
 
 
1
2
 
@@ -1,0 +1,2 @@
+* +!.gitignore \ No newline at end of file
 
 
 
 
 
1
2
 
@@ -1,0 +1,2 @@
+* +!.gitignore \ No newline at end of file
 
303
304
305
 
 
 
 
 
 
 
 
 
 
 
 
 
306
307
308
 
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
@@ -303,6 +303,19 @@
  'b0931cadc54336e78a1d980420e3268903b57a50',   }, t.refs.as_dict())   + def test_clone_empty(self): + """Test clone() doesn't crash if HEAD points to a non-existing ref. + + This simulates cloning server-side bare repository either when it is + still empty or if user renames master branch and pushes private repo + to the server. + Non-bare repo HEAD always points to an existing ref. + """ + r = self._repo = open_repo('empty.git') + tmp_dir = tempfile.mkdtemp() + self.addCleanup(shutil.rmtree, tmp_dir) + r.clone(tmp_dir, mkdir=False, bare=True) +   def test_merge_history(self):   r = self._repo = open_repo('simple_merge.git')   shas = [e.commit.id for e in r.get_walker()]