Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 266513 Details for
Bug 511295
Merge commits cannot be created on Node
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
JavaScript file that will generate to a merge conflict.
bug.js (text/plain), 2.00 KB, created by
Remy Suen
on 2017-01-30 05:10:42 EST
(
hide
)
Description:
JavaScript file that will generate to a merge conflict.
Filename:
MIME Type:
Creator:
Remy Suen
Created:
2017-01-30 05:10:42 EST
Size:
2.00 KB
patch
obsolete
>var path = require("path"); >var fs = require("fs"); >var git = require('nodegit'); >var repoDir = path.resolve(__dirname, "merge-commit-bug"); >var name = "test.txt"; >var fileName = path.resolve(repoDir, name); >var repository; >var index; >var head; >var left; >var right; > >return git.Repository.init(repoDir, 0) >.then(function(repo) { > repository = repo; > fs.writeFileSync(fileName, "A", null); > return repository.refreshIndex(); >}) >.then(function(idx) { > index = idx; > return index.addByPath(name); >}) >.then(function() { > return index.writeTree(); >}) >.then(function(oid) { > return repository.createCommit("HEAD", > git.Signature.default(repository), > git.Signature.default(repository), > "message", oid, []); >}) >.then(function(oid) { > head = oid; > fs.writeFileSync(fileName, "B", null); > return repository.refreshIndex(); >}) >.then(function(idx) { > index = idx; > return index.addByPath(name); >}) >.then(function() { > return index.write(); >}) >.then(function() { > return index.writeTree(); >}) >.then(function(oid) { > return repository.createCommit("HEAD", > git.Signature.default(repository), > git.Signature.default(repository), > "left", oid, [ head ]); >}) >.then(function(_left) { > left = _left; > return repository.getCommit(head); >}) >.then(function(commit) { > return git.Reset.reset(repository, commit, git.Reset.TYPE.HARD, {}); >}) >.then(function() { > fs.writeFileSync(fileName, "C", null); > return repository.refreshIndex(); >}) >.then(function(idx) { > index = idx; > return index.addByPath(name); >}) >.then(function() { > return index.write(); >}) >.then(function() { > return index.writeTree(); >}) >.then(function(oid) { > return repository.createCommit("HEAD", > git.Signature.default(repository), > git.Signature.default(repository), > "right", oid, [ head ]); >}) >.then(function() { > return git.AnnotatedCommit.lookup(repository, left); >}) >.then(function(commit) { > return git.Merge.merge(repository, commit, null, null); >}) >.catch(function(err) { > console.log(err); >}); >;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 511295
: 266513