Created
          April 27, 2013 18:30 
        
      - 
      
- 
        Save txdv/5474093 to your computer and use it in GitHub Desktop. 
    orphan commit creation
  
        
  
    
      This file contains hidden or 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
    
  
  
    
  | var blob = repo.ObjectDatabase.CreateBlob("index.txt"); | |
| var treeDefinition = new TreeDefinition(); | |
| treeDefinition.Add("index.txt", blob, Mode.NonExecutableFile); | |
| var tree = repo.ObjectDatabase.CreateTree(treeDefinition); | |
| var commit = repo.ObjectDatabase.CreateCommit("Hello World", | |
| new Signature("name", "mail", DateTimeOffset.Now), | |
| new Signature("name", "mail", DateTimeOffset.Now), | |
| tree, new Commit[0]); | |
| repo.Branches.Add("index", commit); | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment