-
-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
140 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# `isomorphic-git` running on `memfs` in-memory file system | ||
|
||
This demo shows how to run `isomorphic-git` on `memfs` in-memory file system. It | ||
creates a new folder `/repo`, then inits a Git repository there, then creates a | ||
a file `/repo/README.md` and commits it. | ||
|
||
Run: | ||
|
||
``` | ||
yarn | ||
npx ts-node demo/isomorphic-git/index.ts | ||
``` |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Run: npx ts-node demo/isomorphic-git/index.ts | ||
|
||
import git from 'isomorphic-git'; | ||
import {memfs} from '../../src'; | ||
|
||
const main = async () => { | ||
const fs = memfs(); | ||
|
||
fs.mkdirSync('/repo'); | ||
console.log('New folder:', (<any>fs).__vol.toJSON()); | ||
|
||
await git.init({fs, dir: '/repo'}); | ||
console.log('Git init:', (<any>fs).__vol.toJSON()); | ||
|
||
fs.writeFileSync('/repo/README.md', 'Hello World\n'); | ||
console.log('README added:', (<any>fs).__vol.toJSON()); | ||
|
||
await git.add({fs, dir: '/repo', filepath: 'README.md'}); | ||
console.log('README staged:', (<any>fs).__vol.toJSON()); | ||
|
||
await git.commit({ | ||
fs, | ||
dir: '/repo', | ||
author: {name: 'Git', email: '[email protected]'}, | ||
message: 'fea: initial commit', | ||
}); | ||
console.log('README committed:', (<any>fs).__vol.toJSON()); | ||
}; | ||
|
||
main(); |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1733,6 +1733,11 @@ assert@^2.0.0: | |
object-is "^1.0.1" | ||
util "^0.12.0" | ||
|
||
async-lock@^1.1.0: | ||
version "1.4.0" | ||
resolved "https://registry.yarnpkg.com/async-lock/-/async-lock-1.4.0.tgz#c8b6630eff68fbbdd8a5b6eb763dac3bfbb8bf02" | ||
integrity sha512-coglx5yIWuetakm3/1dsX9hxCNox22h7+V80RQOu2XUUMidtArxKoZoOtHUPuR84SycKTXzgGzAUR5hJxujyJQ== | ||
|
||
available-typed-arrays@^1.0.5: | ||
version "1.0.5" | ||
resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" | ||
|
@@ -2135,6 +2140,11 @@ clean-css@^5.2.2: | |
dependencies: | ||
source-map "~0.6.0" | ||
|
||
clean-git-ref@^2.0.1: | ||
version "2.0.1" | ||
resolved "https://registry.yarnpkg.com/clean-git-ref/-/clean-git-ref-2.0.1.tgz#dcc0ca093b90e527e67adb5a5e55b1af6816dcd9" | ||
integrity sha512-bLSptAy2P0s6hU4PzuIMKmMJJSE6gLXGH1cntDu7bWJUksvuM+7ReOK61mozULErYvP6a15rnYl0zFDef+pyPw== | ||
|
||
clean-stack@^2.0.0: | ||
version "2.2.0" | ||
resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" | ||
|
@@ -2405,6 +2415,11 @@ cosmiconfig@^7.0.0: | |
path-type "^4.0.0" | ||
yaml "^1.10.0" | ||
|
||
crc-32@^1.2.0: | ||
version "1.2.2" | ||
resolved "https://registry.yarnpkg.com/crc-32/-/crc-32-1.2.2.tgz#3cad35a934b8bf71f25ca524b6da51fb7eace2ff" | ||
integrity sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ== | ||
|
||
create-require@^1.1.0: | ||
version "1.1.1" | ||
resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" | ||
|
@@ -2482,6 +2497,13 @@ decamelize@^1.1.0: | |
resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" | ||
integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA== | ||
|
||
decompress-response@^6.0.0: | ||
version "6.0.0" | ||
resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-6.0.0.tgz#ca387612ddb7e104bd16d85aab00d5ecf09c66fc" | ||
integrity sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ== | ||
dependencies: | ||
mimic-response "^3.1.0" | ||
|
||
dedent@^0.7.0: | ||
version "0.7.0" | ||
resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" | ||
|
@@ -2591,6 +2613,11 @@ diff-sequences@^28.1.1: | |
resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-28.1.1.tgz#9989dc731266dc2903457a70e996f3a041913ac6" | ||
integrity sha512-FU0iFaH/E23a+a718l8Qa/19bF9p06kgE0KipMOMadwa3SjnaElKzPaUC0vnibs6/B/9ni97s61mcejk8W1fQw== | ||
|
||
[email protected]: | ||
version "0.0.3" | ||
resolved "https://registry.yarnpkg.com/diff3/-/diff3-0.0.3.tgz#d4e5c3a4cdf4e5fe1211ab42e693fcb4321580fc" | ||
integrity sha512-iSq8ngPOt0K53A6eVr4d5Kn6GNrM2nQZtC740pzIriHtn4pOQ2lyzEXQMBeVcWERN0ye7fhBsk9PbLLQOnUx/g== | ||
|
||
diff@^4.0.1: | ||
version "4.0.2" | ||
resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" | ||
|
@@ -3822,6 +3849,23 @@ isobject@^3.0.1: | |
resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" | ||
integrity sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg== | ||
|
||
isomorphic-git@^1.24.2: | ||
version "1.24.2" | ||
resolved "https://registry.yarnpkg.com/isomorphic-git/-/isomorphic-git-1.24.2.tgz#16ee555f1cc8a812bb1337fa6d90def7f7ad03e6" | ||
integrity sha512-J3TU97JENWUnOgpVMwaRP9a3OQXJq/8fCIzA4yrJ7+ko1IPJwXCYeA69CeC8GtHeBVhcOQrbZGw6fpIpz54Vpw== | ||
dependencies: | ||
async-lock "^1.1.0" | ||
clean-git-ref "^2.0.1" | ||
crc-32 "^1.2.0" | ||
diff3 "0.0.3" | ||
ignore "^5.1.4" | ||
minimisted "^2.0.0" | ||
pako "^1.0.10" | ||
pify "^4.0.1" | ||
readable-stream "^3.4.0" | ||
sha.js "^2.4.9" | ||
simple-get "^4.0.1" | ||
|
||
issue-parser@^6.0.0: | ||
version "6.0.0" | ||
resolved "https://registry.yarnpkg.com/issue-parser/-/issue-parser-6.0.0.tgz#b1edd06315d4f2044a9755daf85fdafde9b4014a" | ||
|
@@ -4746,6 +4790,11 @@ mimic-fn@^2.1.0: | |
resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" | ||
integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== | ||
|
||
mimic-response@^3.1.0: | ||
version "3.1.0" | ||
resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-3.1.0.tgz#2d1d59af9c1b129815accc2c46a022a5ce1fa3c9" | ||
integrity sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ== | ||
|
||
min-indent@^1.0.0: | ||
version "1.0.1" | ||
resolved "https://registry.yarnpkg.com/min-indent/-/min-indent-1.0.1.tgz#a63f681673b30571fbe8bc25686ae746eefa9869" | ||
|
@@ -4784,6 +4833,13 @@ minimist@^1.2.0, minimist@^1.2.5, minimist@^1.2.6: | |
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" | ||
integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== | ||
|
||
minimisted@^2.0.0: | ||
version "2.0.1" | ||
resolved "https://registry.yarnpkg.com/minimisted/-/minimisted-2.0.1.tgz#d059fb905beecf0774bc3b308468699709805cb1" | ||
integrity sha512-1oPjfuLQa2caorJUM8HV8lGgWCc0qqAO1MNv/k05G4qslmsndV/5WdNZrqCiyqiz3wohia2Ij2B7w2Dr7/IyrA== | ||
dependencies: | ||
minimist "^1.2.5" | ||
|
||
minipass-collect@^1.0.2: | ||
version "1.0.2" | ||
resolved "https://registry.yarnpkg.com/minipass-collect/-/minipass-collect-1.0.2.tgz#22b813bf745dc6edba2576b940022ad6edc8c617" | ||
|
@@ -5415,6 +5471,11 @@ pacote@^13.0.3, pacote@^13.6.1, pacote@^13.6.2: | |
ssri "^9.0.0" | ||
tar "^6.1.11" | ||
|
||
pako@^1.0.10: | ||
version "1.0.11" | ||
resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.11.tgz#6c9599d340d54dfd3946380252a35705a6b992bf" | ||
integrity sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw== | ||
|
||
param-case@^3.0.4: | ||
version "3.0.4" | ||
resolved "https://registry.yarnpkg.com/param-case/-/param-case-3.0.4.tgz#7d17fe4aa12bde34d4a77d91acfb6219caad01c5" | ||
|
@@ -5525,6 +5586,11 @@ pify@^3.0.0: | |
resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" | ||
integrity sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg== | ||
|
||
pify@^4.0.1: | ||
version "4.0.1" | ||
resolved "https://registry.yarnpkg.com/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231" | ||
integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g== | ||
|
||
pirates@^4.0.4: | ||
version "4.0.5" | ||
resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.5.tgz#feec352ea5c3268fb23a37c702ab1699f35a5f3b" | ||
|
@@ -5811,7 +5877,7 @@ read@1, read@^1.0.7, read@~1.0.7: | |
dependencies: | ||
mute-stream "~0.0.4" | ||
|
||
readable-stream@3, readable-stream@^3.0.0, readable-stream@^3.0.6, readable-stream@^3.6.0: | ||
readable-stream@3, readable-stream@^3.0.0, readable-stream@^3.0.6, readable-stream@^3.4.0, readable-stream@^3.6.0: | ||
version "3.6.2" | ||
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.2.tgz#56a9b36ea965c00c5a93ef31eb111a0f11056967" | ||
integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA== | ||
|
@@ -5985,7 +6051,7 @@ [email protected], safe-buffer@~5.1.0, safe-buffer@~5.1.1: | |
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" | ||
integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== | ||
|
||
[email protected], safe-buffer@>=5.1.0, safe-buffer@^5.1.0, safe-buffer@~5.2.0: | ||
[email protected], safe-buffer@>=5.1.0, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@~5.2.0: | ||
version "5.2.1" | ||
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" | ||
integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== | ||
|
@@ -6153,6 +6219,14 @@ [email protected]: | |
resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" | ||
integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== | ||
|
||
sha.js@^2.4.9: | ||
version "2.4.11" | ||
resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" | ||
integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ== | ||
dependencies: | ||
inherits "^2.0.1" | ||
safe-buffer "^5.0.1" | ||
|
||
shallow-clone@^3.0.0: | ||
version "3.0.1" | ||
resolved "https://registry.yarnpkg.com/shallow-clone/-/shallow-clone-3.0.1.tgz#8f2981ad92531f55035b01fb230769a40e02efa3" | ||
|
@@ -6200,6 +6274,20 @@ signale@^1.2.1: | |
figures "^2.0.0" | ||
pkg-conf "^2.1.0" | ||
|
||
simple-concat@^1.0.0: | ||
version "1.0.1" | ||
resolved "https://registry.yarnpkg.com/simple-concat/-/simple-concat-1.0.1.tgz#f46976082ba35c2263f1c8ab5edfe26c41c9552f" | ||
integrity sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q== | ||
|
||
simple-get@^4.0.1: | ||
version "4.0.1" | ||
resolved "https://registry.yarnpkg.com/simple-get/-/simple-get-4.0.1.tgz#4a39db549287c979d352112fa03fd99fd6bc3543" | ||
integrity sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA== | ||
dependencies: | ||
decompress-response "^6.0.0" | ||
once "^1.3.1" | ||
simple-concat "^1.0.0" | ||
|
||
sisteransi@^1.0.5: | ||
version "1.0.5" | ||
resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed" | ||
|