@@ -283,122 +283,167 @@ def json(key)
283283 }
284284
285285 TREE = {
286- "count" => 3 ,
287286 "sha" => "9fb037999f264ba9a7fc6274d15fa3ae2ab98312" ,
287+ "url" => "https://api.github.com/repo/octocat/Hello-World/trees/9fb037999f264ba9a7fc6274d15fa3ae2ab98312" ,
288288 "tree" => [
289289 { "path" => "file.rb" ,
290290 "mode" => "100644" ,
291291 "type" => "blob" ,
292292 "size" => 30 ,
293- "sha" => "44b4fc6d56897b048c772eb4087f854f46256132"
293+ "sha" => "44b4fc6d56897b048c772eb4087f854f46256132" ,
294+ "url" => "https://api.github.com/octocat/Hello-World/git/blobs/44b4fc6d56897b048c772eb4087f854f46256132" ,
294295 } ,
295296 { "path" => "subdir" ,
296297 "mode" => "040000" ,
297298 "type" => "tree" ,
298- "sha" => "f484d249c660418515fb01c2b9662073663c242e"
299+ "sha" => "f484d249c660418515fb01c2b9662073663c242e" ,
300+ "url" => "https://api.github.com/octocat/Hello-World/git/blobs/f484d249c660418515fb01c2b9662073663c242e"
299301 } ,
300302 { "path" => "exec_file" ,
301303 "mode" => "100755" ,
302304 "type" => "blob" ,
303305 "size" => 75 ,
304- "sha" => "45b983be36b73c0788dc9cbcb76cbb80fc7bb057"
306+ "sha" => "45b983be36b73c0788dc9cbcb76cbb80fc7bb057" ,
307+ "url" => "https://api.github.com/octocat/Hello-World/git/blobs/45b983be36b73c0788dc9cbcb76cbb80fc7bb057" ,
305308 }
306309 ]
307310 }
308311 TREE_EXTRA = {
309- "count" => 4 ,
310- "tree" => {
312+ "sha" => "fc6274d15fa3ae2ab983129fb037999f264ba9a7" ,
313+ "url" => "https://api.github.com/repo/octocat/Hello-World/trees/fc6274d15fa3ae2ab983129fb037999f264ba9a7" ,
314+ "tree" => [ {
311315 "path" => "subdir/file.txt" ,
312316 "mode" => "100644" ,
313317 "type" => "blob" ,
314318 "size" => 132 ,
315- "sha" => "7c258a9869f33c1e1e1f74fbb32f07c86cb5a75b"
316- }
319+ "sha" => "7c258a9869f33c1e1e1f74fbb32f07c86cb5a75b" ,
320+ "url" => "https://api.github.com/octocat/Hello-World/git/7c258a9869f33c1e1e1f74fbb32f07c86cb5a75b"
321+ } ]
322+ }
323+ TREE_NEW = {
324+ "sha" => "cd8274d15fa3ae2ab983129fb037999f264ba9a7" ,
325+ "url" => "https://api.github.com/repo/octocat/Hello-World/trees/cd8274d15fa3ae2ab983129fb037999f264ba9a7" ,
326+ "tree" => [ {
327+ "path" => "file.rb" ,
328+ "mode" => "100644" ,
329+ "type" => "blob" ,
330+ "size" => 132 ,
331+ "sha" => "7c258a9869f33c1e1e1f74fbb32f07c86cb5a75b" ,
332+ "url" => "https://api.github.com/octocat/Hello-World/git/blobs/7c258a9869f33c1e1e1f74fbb32f07c86cb5a75b"
333+ } ]
317334 }
318- FULL_TREE = TREE . merge ( TREE_EXTRA ) do |k , o , n |
319- k == 'tree' ? o << n : n
320- end
321335
322336 COMMIT = {
323- "sha" => "cd52fced9c728f3a37578620e9d6135a55eb2ef2" ,
337+ "sha" => "7638417db6d59f3c431d3e1f261cc637155684cd" ,
338+ "url" => "https://api.github.com/repos/octocat/Hello-World/git/commits/7638417db6d59f3c431d3e1f261cc637155684cd" ,
324339 "author" => {
325- "name" => "Scott Chacon " ,
326- "email " => "scott@github.com " ,
327- "date" => "2008-07-09T16:13:30+12:00 "
340+ "date" => "2010-04-10T14:10:01-07:00 " ,
341+ "name " => "Scott Chacon " ,
342+ "email" => "schacon@gmail.com "
328343 } ,
329344 "committer" => {
330- "name" => "Scott Chacon" ,
331- "email" => "scott@github.com" ,
332- "date" => "2008-07-09T16:13:30+12:00"
345+ "date" => "2010-04-10T14:10:01-07:00" ,
346+ "name" => "Scott Chacon" ,
347+ "email" => "schacon@gmail.com"
348+ } ,
349+ "message" => "added readme, because im a good github citizen\n " ,
350+ "tree" => {
351+ "url" => "https://api.github.com/repos/octocat/Hello-World/git/trees/691272480426f78a0138979dd3ce63b77f706feb" ,
352+ "sha" => "691272480426f78a0138979dd3ce63b77f706feb"
333353 } ,
334- "message" => "my commit message" ,
335- "tree" => "9fb037999f264ba9a7fc6274d15fa3ae2ab98312" ,
336- "parents" => [ "7d1b31e74ee336d15cbd21741bc88a537ed063a0" ]
354+ "parents" => [
355+ {
356+ "url" => "https://api.github.com/repos/octocat/Hello-World/git/commits/1acc419d4d6a9ce985db7be48c6349a0475975b5" ,
357+ "sha" => "1acc419d4d6a9ce985db7be48c6349a0475975b5"
358+ }
359+ ]
337360 }
338361
339- COMMITS_REST = [
340- { "sha" => "7d1b31e74ee336d15cbd21741bc88a537ed063a0" ,
341- "author" => {
342- "name" => "Scott Chacon" ,
343- "email" => "scott@github.com" ,
344- "date" => "2008-07-08T16:13:30+12:00"
345- } ,
346- "committer" => {
347- "name" => "Scott Chacon" ,
348- "email" => "scott@github.com" ,
349- "date" => "2008-07-08T16:13:30+12:00"
350- } ,
351- "message" => "my older commit message" ,
352- "tree" => "392662aae29f314a428bfc6b619d97bd4ad4a727" ,
353- "parents" => [ "afc99de753646e2c438203430e97671971740d35" ]
362+ NEW_COMMIT = {
363+ "sha" => "7638417db6d59f3c431d3e1f261cc637155684cd" ,
364+ "url" => "https://api.github.com/repos/octocat/Hello-World/git/commits/7638417db6d59f3c431d3e1f261cc637155684cd" ,
365+ "author" => {
366+ "date" => "2008-07-09T16:13:30+12:00" ,
367+ "name" => "Scott Chacon" ,
368+ "email" => "schacon@gmail.com"
354369 } ,
355- { "sha" => "afc99de753646e2c438203430e97671971740d35" ,
356- "author" => {
357- "name" => "Scott Chacon" ,
358- "email" => "scott@github.com" ,
359- "date" => "2008-07-07T16:13:30+12:00"
360- } ,
361- "committer" => {
362- "name" => "Scott Chacon" ,
363- "email" => "scott@github.com" ,
364- "date" => "2008-07-07T16:13:30+12:00"
365- } ,
366- "message" => "my first commit message" ,
367- "tree" => "8bcac778496eb77c1928aa9778f5112c6a822a19" ,
368- "parents" => [ ]
369- }
370- ]
371-
372- COMMITS = [ COMMIT ] + COMMITS_REST
373-
370+ "committer" => {
371+ "date" => "2008-07-09T16:13:30+12:00" ,
372+ "name" => "Scott Chacon" ,
373+ "email" => "schacon@gmail.com"
374+ } ,
375+ "message" => "my commit message" ,
376+ "tree" => {
377+ "url" => "https://api.github.com/repos/octocat/Hello-World/git/trees/827efc6d56897b048c772eb4087f854f46256132" ,
378+ "sha" => "827efc6d56897b048c772eb4087f854f46256132"
379+ } ,
380+ "parents" => [
381+ {
382+ "url" => "https://api.github.com/repos/octocat/Hello-World/git/commits/7d1b31e74ee336d15cbd21741bc88a537ed063a0" ,
383+ "sha" => "7d1b31e74ee336d15cbd21741bc88a537ed063a0"
384+ }
385+ ]
386+ }
387+
374388 TAG = {
375- "sha" => "b8d04eddde9f53f3bc76dd048f3477062a27c91a" ,
376- "tag" => "v1.0" ,
389+ "tag" => "v0.0.1" ,
390+ "sha" => "940bd336248efae0f9ee5bc7b2d5c985887b16ac" ,
391+ "url" => "https://api.github.com/repos/octocat/Hello-World/git/tags/940bd336248efae0f9ee5bc7b2d5c985887b16ac" ,
392+ "message" => "initial version\n " ,
377393 "tagger" => {
378- "name" => "Scott Chacon" ,
379- "email" => "scott@github .com" ,
380- "date" => "2008-07-09T16:13:30+12 :00"
394+ "name" => "Scott Chacon" ,
395+ "email" => "schacon@gmail .com" ,
396+ "date" => "2011-06-17T14:53:35-07 :00"
381397 } ,
382- "message" => "my tag message" ,
383- "object" => "9fb037999f264ba9a7fc6274d15fa3ae2ab98312" ,
384- "type" => "commit"
398+ "object" => {
399+ "type" => "commit" ,
400+ "sha" => "c3d0be41ecbe669545ee3e94d31ed9a4bc91ee3c" ,
401+ "url" => "https://api.github.com/repos/octocat/Hello-World/git/commits/c3d0be41ecbe669545ee3e94d31ed9a4bc91ee3c"
402+ }
385403 }
386404
387- REFS = [
388- { "ref" => "refs/heads/master" ,
389- "sha" => "75e41c7ddf122d799730c39d2295ee840d9b7b08" ,
390- "type" => "commit" } ,
391- { "ref" => "refs/heads/gh-page" ,
392- "sha" => "1bb58aecaf6bbcf9f7e39dff2e42e0291f42d235" ,
393- "type" => "commit" } ,
394- { "ref" => "refs/tags/v0.1" ,
395- "sha" => "be87be3a49e75474e438a9a9f44b3deafb0af01c" ,
396- "type" => "tag" } ,
397- { "ref" => "refs/notes/commits" ,
398- "sha" => "1bb58aecaf6bbcf9f7e39dff2e42e0291f42d235" ,
399- "type" => "commit" } ,
405+ REF = [
406+ {
407+ "ref" => "refs/heads/sc/featureA" ,
408+ "url" => "https://api.github.com/repos/octocat/Hello-World/git/refs/heads/sc/featureA" ,
409+ "object" => {
410+ "type" => "commit" ,
411+ "sha" => "aa218f56b14c9653891f9e74264a383fa43fefbd" ,
412+ "url" => "https://api.github.com/repos/octocat/Hello-World/git/commits/aa218f56b14c9653891f9e74264a383fa43fefbd"
413+ }
414+ }
400415 ]
401416
417+ REFS = [
418+ {
419+ "ref" => "refs/heads/master" ,
420+ "url" => "https://api.github.com/repos/octocat/Hello-World/git/refs/heads/master" ,
421+ "object" => {
422+ "type" => "commit" ,
423+ "sha" => "aa218f56b14c9653891f9e74264a383fa43fefbd" ,
424+ "url" => "https://api.github.com/repos/octocat/Hello-World/git/commits/aa218f56b14c9653891f9e74264a383fa43fefbd"
425+ }
426+ } ,
427+ {
428+ "ref" => "refs/heads/gh-pages" ,
429+ "url" => "https://api.github.com/repos/octocat/Hello-World/git/refs/heads/gh-pages" ,
430+ "object" => {
431+ "type" => "commit" ,
432+ "sha" => "612077ae6dffb4d2fbd8ce0cccaa58893b07b5ac" ,
433+ "url" => "https://api.github.com/repos/octocat/Hello-World/git/commits/612077ae6dffb4d2fbd8ce0cccaa58893b07b5ac"
434+ }
435+ } ,
436+ {
437+ "ref" => "refs/tags/v0.0.1" ,
438+ "url" => "https://api.github.com/repos/octocat/Hello-World/git/refs/tags/v0.0.1" ,
439+ "object" => {
440+ "type" => "tag" ,
441+ "sha" => "940bd336248efae0f9ee5bc7b2d5c985887b16ac" ,
442+ "url" => "https://api.github.com/repos/octocat/Hello-World/git/tags/940bd336248efae0f9ee5bc7b2d5c985887b16ac"
443+ }
444+ }
445+ ]
446+
402447 end
403448end
404449
0 commit comments