First of all I want to say I loved this challenge (including the painful git clone stage)! I decided to go a bit further and add more Git functionality to my implementation, such as the index. Then I decided to move the git write-tree implementation I had from using the working tree to using the index. However, after doing that the stage FE4 started failing because it does not seem to add any files to the index (correct me if I am wrong). I understand that as a first version it is easier to just work with the working tree as I did too (which is of course not true to Git). But would it be possible to add a ‘git add .’ before the call to git work-tree with the real git? Then the test would match the true behavior of Git, simply returning the hash of an empty tree as the index is empty. In the normal case no one would look at the index file anyways, so it should not be so disruptive?
1 Like
Yep, had the same thought.
Actually lack of staging area spoiled my otherwise perfect solution. I continuously write my logs in program folder (because why not) and when my write-tree parses files, it sees one log file, but the tester comes later and by that moment log-file changed, hash changed, failed test, thank you very much!
1 Like
Great suggestion, think this’d be easy for us to do without breaking anything. @andy1li can we look into this please?
