alx3apps/jgit-buildnumber — pull request #11 by smoothreggae (2014-06-02 01:36:48+00:00)
Title: use correct idiom to map to the current directory

The instance created by new File("") fails both the exists() and
isDirectory() tests even though both getAbsolutePath() and
getCanonicalPath() will return the current directory.

The task is expected to default to the current working directory when
git.repositoryDirectory is not set.

If new File("") is used instead of new File(".") to create an instance
of File defaulting to the current directory, the instance fails both the
exists() and isDirectory() tests even though both getAbsolutePath() and
getCanonicalPath() will return the current directory.

The build number extractor fails, because exists() and isDirectory()
both return false. The detail message in the instance of IOException
that it creates uses getCanonicalPath() (which returns the current
directory). This results in a confusing error message that leads the
user to conclude that the current working directory is not a valid git
working directory despite being one.