Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 337463

Summary: [server] Provide REST API to get file content from index
Product: [ECD] Orion Reporter: Tomasz Zarna <tomasz.zarna>
Component: ClientAssignee: Tomasz Zarna <tomasz.zarna>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: libingw
Version: 0.2   
Target Milestone: 0.2   
Hardware: PC   
OS: All   
URL: http://wiki.eclipse.org/Orion/How_Tos/Working_with_git
Whiteboard:
Bug Depends on:    
Bug Blocks: 334206    

Description Tomasz Zarna CLA 2011-02-17 11:35:14 EST
Compare editor needs an API that would return a file content from the git index. The URL could look like this: /git/index/<file path>.
Comment 1 Tomasz Zarna CLA 2011-02-18 09:04:55 EST
File content kept in the index can be retrieved by calling GET on /git/index/file/<path>.

I haven't tested it extensively, so I'm not sure what would happen if you try to get index for a folder or a file which hasn't been modified. But it works for the simplest case what you have a modified file in the working tree and would like to see the original content (in index). If you find something unexpected, please open a bug and assign to me right away.

Fixed with 5e3db69a9bb4671cfd4cbc0762b55c76e13499ac.