Skip to content

Commit 7f6fd7e

Browse files
Log HEAD and FETCH_HEAD at repo creation
1 parent c4863ef commit 7f6fd7e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/GitVersionCore/ExecuteCore.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,13 @@ IRepository GetRepository(string gitDirectory)
108108
try
109109
{
110110
Logger.WriteInfo (string.Format ("Initializing Repository at {0}", gitDirectory));
111-
var repository = new Repository(gitDirectory);
111+
if (System.IO.File.Exists (System.IO.Path.Combine (gitDirectory, "HEAD"))) {
112+
Logger.WriteInfo (string.Format ("HEAD = {0}", System.IO.File.ReadAllText (System.IO.Path.Combine (gitDirectory, "HEAD"))));
113+
}
114+
if (System.IO.File.Exists (System.IO.Path.Combine (gitDirectory, "FETCH_HEAD"))) {
115+
Logger.WriteInfo (string.Format ("FETCH_HEAD = {0}", System.IO.File.ReadAllText (System.IO.Path.Combine (gitDirectory, "FETCH_HEAD"))));
116+
}
117+
var repository = new Repository(gitDirectory);
112118
Logger.WriteInfo (string.Format ("At repo init: refs/HEAD is a {0} at {1} ({2})", repository.Refs.Head.GetType (), repository.Refs.Head.TargetIdentifier, repository.Refs.Head.ResolveToDirectReference ().Target.Sha));
113119

114120
var branch = repository.Head;

0 commit comments

Comments
 (0)