| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -163,9 +163,12 @@ Reference.updateTerminal = function ( | |||
| 163 | 163 | }) | |
| 164 | 164 | .then(() => NodeGit.Reflog.read(repo, refName)) | |
| 165 | 165 | .then((reflog) => { | |
| 166 | - // We may want some kind of transactional logic for this | ||
| 167 | - // There is a theoretical timing issue that could result in updating | ||
| 168 | - // the wrong reflog | ||
| 166 | + // Janky, but works. Ideally, we would want to generate the correct reflog | ||
| 167 | + // entry in the first place, rather than drop the most recent entry and | ||
| 168 | + // write the correct one. | ||
| 169 | + // NOTE: There is a theoretical race condition that could happen here. | ||
| 170 | + // We may want to consider some kind of transactional logic to make sure | ||
| 171 | + // that the reflog on disk isn't modified before we can write back. | ||
| 169 | 172 | reflog.drop(0, 1); | |
| 170 | 173 | reflog.append(oid, signatureToUse, logMessage); | |
| 171 | 174 | return reflog.write(); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments