You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 2, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Dec 2, 2026. It is now read-only.
I'm running a script that check a repo for Diff.indexToWorkdir every interval, like so:
// runs in interval every 1s.then(()=>{returngit.Repository.open('../my_repo_path');}).then((repo)=>{returngit.Diff.indexToWorkdir(repo);}).then((repoDiff)=>{returnrepoDiff.toBuf(git.Diff.FORMAT.PATCH);})
Note that after a repository is free'd, all the objects it has spawned will still exist until they are manually closed by the user with git_object_free, but accessing any of the attributes of an object without a backing repository will result in undefined behavior
But I didn't find a way to do this since repoDiff.toBuf return a Promise which returns a string.
It seems the Buf is only available in the C++ implementation. (see NAN_METHOD(GitDiff::ToBuf) )
The Buf you're talking about is separate from freeing the Diff. Couldn't you simply enable the git_diff_free method, by dropping the ignore: true and then passing your repoDiff to git.Diff.free(repoDiff)?
Activity
tbranyen commentedon Sep 17, 2018
The
Bufyou're talking about is separate from freeing theDiff. Couldn't you simply enable thegit_diff_freemethod, by dropping theignore: trueand then passing yourrepoDifftogit.Diff.free(repoDiff)?We could also add
freeto therepoDiffprototype.implausible commentedon Oct 17, 2018
I think this issue should be resolved from #1570.