| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
24 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -35,11 +35,10 @@ nodegit.Repository.open(path.resolve(__dirname, "../.git")) | |||
| 35 | 35 | ); | |
| 36 | 36 | }) | |
| 37 | 37 | .then(function() { | |
| 38 | - return repo.openIndex(); | ||
| 38 | + return repo.refreshIndex(); | ||
| 39 | 39 | }) | |
| 40 | 40 | .then(function(indexResult) { | |
| 41 | 41 | index = indexResult; | |
| 42 | - return index.read(1); | ||
| 43 | 42 | }) | |
| 44 | 43 | .then(function() { | |
| 45 | 44 | // this file is in the root of the directory and doesn't need a full path | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,11 +20,10 @@ fse.ensureDir(path.resolve(__dirname, repoDir)) | |||
| 20 | 20 | return fse.writeFile(path.join(repository.workdir(), fileName), fileContent); | |
| 21 | 21 | }) | |
| 22 | 22 | .then(function(){ | |
| 23 | - return repository.openIndex(); | ||
| 23 | + return repository.refreshIndex(); | ||
| 24 | 24 | }) | |
| 25 | 25 | .then(function(idx) { | |
| 26 | 26 | index = idx; | |
| 27 | - return index.read(1); | ||
| 28 | 27 | }) | |
| 29 | 28 | .then(function() { | |
| 30 | 29 | return index.addByPath(fileName); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,7 +13,7 @@ nodegit.Repository.open(path.resolve(__dirname, "../.git")) | |||
| 13 | 13 | ||
| 14 | 14 | // Tree entry doesn't have any data associated with the actual entry | |
| 15 | 15 | // To get that we need to get the index entry that this points to | |
| 16 | - return repo.openIndex().then(function(index) { | ||
| 16 | + return repo.refreshIndex().then(function(index) { | ||
| 17 | 17 | var indexEntry = index.getByPath(treeEntry.path()); | |
| 18 | 18 | ||
| 19 | 19 | // With the index entry we can now view the details for the tree entry | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -319,7 +319,7 @@ nodegit.Repository.open(path.resolve(__dirname, "../.git")) | |||
| 319 | 319 | ||
| 320 | 320 | // The [index file API][gi] allows you to read, traverse, update and write | |
| 321 | 321 | // the Git index file (sometimes thought of as the staging area). | |
| 322 | - return repo.openIndex(); | ||
| 322 | + return repo.refreshIndex(); | ||
| 323 | 323 | }) | |
| 324 | 324 | ||
| 325 | 325 | .then(function(index) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,7 +5,7 @@ var fse = promisify(require("fs-extra")); | |||
| 5 | 5 | ||
| 6 | 6 | nodegit.Repository.open(path.resolve(__dirname, "../.git")) | |
| 7 | 7 | .then(function(repo) { | |
| 8 | - return repo.openIndex() | ||
| 8 | + return repo.refreshIndex() | ||
| 9 | 9 | .then(function(index) { | |
| 10 | 10 | var fileContent = { | |
| 11 | 11 | newFile1: "this has some content", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -43,10 +43,9 @@ fse.remove(path.resolve(__dirname, repoDir)) | |||
| 43 | 43 | ||
| 44 | 44 | // Load up the repository index and make our initial commit to HEAD | |
| 45 | 45 | .then(function() { | |
| 46 | - return repository.openIndex(); | ||
| 46 | + return repository.refreshIndex(); | ||
| 47 | 47 | }) | |
| 48 | 48 | .then(function(index) { | |
| 49 | - index.read(1); | ||
| 50 | 49 | index.addByPath(ourFileName); | |
| 51 | 50 | index.write(); | |
| 52 | 51 | ||
@@ -79,10 +78,9 @@ fse.remove(path.resolve(__dirname, repoDir)) | |||
| 79 | 78 | ); | |
| 80 | 79 | }) | |
| 81 | 80 | .then(function() { | |
| 82 | - return repository.openIndex(); | ||
| 81 | + return repository.refreshIndex(); | ||
| 83 | 82 | }) | |
| 84 | 83 | .then(function(index) { | |
| 85 | - index.read(1); | ||
| 86 | 84 | index.addByPath(theirFileName); | |
| 87 | 85 | index.write(); | |
| 88 | 86 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -49,10 +49,9 @@ fse.remove(path.resolve(__dirname, repoDir)) | |||
| 49 | 49 | ||
| 50 | 50 | // Load up the repository index and make our initial commit to HEAD | |
| 51 | 51 | .then(function() { | |
| 52 | - return repository.openIndex(); | ||
| 52 | + return repository.refreshIndex(); | ||
| 53 | 53 | }) | |
| 54 | 54 | .then(function(index) { | |
| 55 | - index.read(1); | ||
| 56 | 55 | index.addByPath(fileName); | |
| 57 | 56 | index.write(); | |
| 58 | 57 | ||
@@ -94,9 +93,8 @@ fse.remove(path.resolve(__dirname, repoDir)) | |||
| 94 | 93 | ); | |
| 95 | 94 | }) | |
| 96 | 95 | .then(function() { | |
| 97 | - return repository.openIndex() | ||
| 96 | + return repository.refreshIndex() | ||
| 98 | 97 | .then(function(index) { | |
| 99 | - index.read(1); | ||
| 100 | 98 | index.addByPath(fileName); | |
| 101 | 99 | index.write(); | |
| 102 | 100 | ||
@@ -122,8 +120,7 @@ fse.remove(path.resolve(__dirname, repoDir)) | |||
| 122 | 120 | ); | |
| 123 | 121 | }) | |
| 124 | 122 | .then(function() { | |
| 125 | - return repository.openIndex().then(function(index) { | ||
| 126 | - index.read(1); | ||
| 123 | + return repository.refreshIndex().then(function(index) { | ||
| 127 | 124 | index.addByPath(fileName); | |
| 128 | 125 | index.write(); | |
| 129 | 126 | ||
@@ -173,9 +170,8 @@ fse.remove(path.resolve(__dirname, repoDir)) | |||
| 173 | 170 | // we need to get a new index as the other one isnt backed to | |
| 174 | 171 | // the repository in the usual fashion, and just behaves weirdly | |
| 175 | 172 | .then(function() { | |
| 176 | - return repository.openIndex().then(function(index) { | ||
| 173 | + return repository.refreshIndex().then(function(index) { | ||
| 177 | 174 | ||
| 178 | - index.read(1); | ||
| 179 | 175 | index.addByPath(fileName); | |
| 180 | 176 | index.write(); | |
| 181 | 177 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -30,10 +30,9 @@ fse.remove(path.resolve(__dirname, repoDir)) | |||
| 30 | 30 | ||
| 31 | 31 | // Load up the repository index and make our initial commit to HEAD | |
| 32 | 32 | .then(function() { | |
| 33 | - return repository.openIndex(); | ||
| 33 | + return repository.refreshIndex(); | ||
| 34 | 34 | }) | |
| 35 | 35 | .then(function(index) { | |
| 36 | - index.read(1); | ||
| 37 | 36 | index.addByPath(fileName); | |
| 38 | 37 | index.write(); | |
| 39 | 38 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -17,11 +17,10 @@ var _oid; | |||
| 17 | 17 | nodegit.Repository.open(path.resolve(__dirname, "../.git")) | |
| 18 | 18 | .then(function(repo) { | |
| 19 | 19 | _repository = repo; | |
| 20 | - return repo.openIndex(); | ||
| 20 | + return repo.refreshIndex(); | ||
| 21 | 21 | }) | |
| 22 | 22 | .then(function(index){ | |
| 23 | 23 | _index = index; | |
| 24 | - return _index.read(); | ||
| 25 | 24 | }) | |
| 26 | 25 | .then(function() { | |
| 27 | 26 | //remove the file from the index... | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1842,7 +1842,11 @@ | |||
| 1842 | 1842 | } | |
| 1843 | 1843 | }, | |
| 1844 | 1844 | "git_repository_set_index": { | |
| 1845 | - "ignore": true | ||
| 1845 | + "args": { | ||
| 1846 | + "index": { | ||
| 1847 | + "isOptional": true | ||
| 1848 | + } | ||
| 1849 | + } | ||
| 1846 | 1850 | }, | |
| 1847 | 1851 | "git_repository_set_odb": { | |
| 1848 | 1852 | "ignore": true | |
| Back | FazBrowse Home | New Git URL |
0 commit comments