Commit Graph

3 Commits

Author SHA1 Message Date
Matt Burke 3b6dd441c3 Use xunit. 2012-08-29 16:52:32 -04:00
Matt Burke 9299d2c69a dos2unix 2012-01-28 11:42:04 -05:00
Tuomas Järvensivu 8fc96a7ebe Fix commit regex used by FindTfsCommits to detect a commit from git log
FindTfsCommits failed in detecting Tfs commits when parsing a
revert commit.

For instance when parsing following git log report the Tfs commit finder
failed when parsing commit 027a14b24280ca3ba24e4c1e52411de35b944442.

Failure occurred when parsing the line
    This reverts commit e096daaf57d937fef3c0c639c3a59232310c6a20.
Old Regex("commit (" + GitTfsConstants.Sha1 + ")") failed by parsing this
as a start of a new commit.
Commit regex is tightened to Regex("^commit (" + Sha1 + ")\\s*$")

Added tests prove that the new Regex handles both commit topic lines
and revert commit subjects.

==================== Example git log report ====================
$ git log --no-color --pretty=medium HEAD
commit 8c7350acc9a1feffa9882badecc625129c9b8943
Merge: 027a14b fe03e90
Author: Tuomas J<C3><A4>rvensivu <tuomas.jarvensivu@reaktor.fi>
Date:   Sun Sep 11 22:16:46 2011 +0300

    Merge commit 'fe03e9009e46c4eb1b961578b201553eb59b11ed'

commit fe03e9009e46c4eb1b961578b201553eb59b11ed
Author: Tuomas J<C3><A4>rvensivu <tuomas.jarvensivu@reaktor.fi>
Date:   Sun Sep 11 22:02:48 2011 +0300

    Change on top of reverted commit

commit 027a14b24280ca3ba24e4c1e52411de35b944442
Merge: 2b9fe0c f3b25d8
Author: Administrator <WIN-R5AMS97DB6H\Administrator>
Date:   Sun Sep 11 18:50:31 2011 +0000

    Subject: Revert "This commit will be reverted."
    Author: Tuomas J<C7><CF>rvensivu tuomas.jarvensivu@reaktor.fi
    Date: Sun, 11 Sep 2011 21:45:01 +0300
    Git commit hash: d5e949694e8d1442921250e0df4fb38d314dce53

    This reverts commit e096daaf57d937fef3c0c639c3a59232310c6a20.

    git-tfs-id: [http://localhost:8888/tfs/GitTfsTestCollection]$/GitTfsTest;C9
==================== Example git log report ====================

Signed-off-by: Tuomas Järvensivu <tuomas.jarvensivu@reaktor.fi>
2011-09-28 11:25:50 +03:00