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

Do not crash when cloning HEAD-less repo

For a git repository HEAD reference is optional.

.clone() would crash at the attempt to update

target repo 'HEAD' reference if source repo is HEAD-less.

Changeset b53142a4e60d

Parent c63ddf638b09

by D-Key

Changes to one file · Browse files at b53142a4e60d Showing diff from parent c63ddf638b09 Diff from another changeset...

Change 1 of 1 Show Entire File dulwich/​repo.py Stacked
 
1383
1384
1385
1386
1387
 
 
 
1388
1389
1390
 
1383
1384
1385
 
 
1386
1387
1388
1389
1390
1391
@@ -1383,8 +1383,9 @@
    # Update target head   head, head_sha = self.refs._follow('HEAD') - target.refs.set_symbolic_ref('HEAD', head) - target['HEAD'] = head_sha + if head is not None and head_sha is not None: + target.refs.set_symbolic_ref('HEAD', head) + target['HEAD'] = head_sha     if not bare:   # Checkout HEAD to target dir