Start new rule with \n if ignore file exists but not in the workspace
The best example I've seen why the code should never ever use
conditional expressions without curly braces. The missing braces and
wrong else block indentation suggested that the "ignoreLine" should be
prepended with a new line in case the file already exists and does not
ends with a new line. The reality was that the "else" block was
following not the first but the second "if", and so the code never did
what requested and ignore file was corrupted with a new ignore rule
added on the same line as the last ignore rule. OMG!
To reproduce, create an ignore file which ends with an ignore rule
without terminating new line. Make sure the files to ignore are outside
the workspace and try to ignore them from the repositories view.
Change-Id: I41631c6b2fd1557024c4d83a8f4f4fc89ecadfe7
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>