Skip to content

Commit

Permalink
Include branch information from post receive hook
Browse files Browse the repository at this point in the history
  • Loading branch information
cargowire committed May 10, 2011
1 parent 323da91 commit bc8becf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Cargowire.CIBridge/HookParsers/CodebaseHqHookParser.cs
Expand Up @@ -24,7 +24,9 @@ public IEnumerable<HookInfo> Parse(NameValueCollection requestData)
commits.Add(new Commit { Author = u, Id = (string)commit["id"], DateTime = DateTime.Parse((string)commit["timestamp"]), Uri = new Uri((string)commit["url"]) });
}
r.Commits = commits;
return new List<HookInfo>(new HookInfo[]{ new HookInfo { User = u, Repository = r } });
string branchName = (string)(JObject)o["ref"];
branchName = branchName.Substring(branchName.LastIndexOf("/") + 1);
return new List<HookInfo>(new HookInfo[] { new HookInfo { Branch = new Branch { Name = branchName, IsMaster = (string.Compare(branchName, "master", true) == 0) }, User = u, Repository = r } });
}
return null;
}
Expand Down
4 changes: 3 additions & 1 deletion Cargowire.CIBridge/HookParsers/GitHubHookParser.cs
Expand Up @@ -24,7 +24,9 @@ public IEnumerable<HookInfo> Parse(NameValueCollection requestData)
commits.Add(new Commit { Author = u, Id = (string)commit["id"], DateTime = DateTime.Parse((string)commit["timestamp"]), Uri = new Uri((string)commit["url"]) });
}
r.Commits = commits;
return new List<HookInfo>(new HookInfo[]{ new HookInfo { User = u, Repository = r } });
string branchName = (string)(JObject)o["ref"];
branchName = branchName.Substring(branchName.LastIndexOf("/") + 1);
return new List<HookInfo>(new HookInfo[] { new HookInfo { Branch = new Branch { Name = branchName, IsMaster = (string.Compare(branchName, "master", true) == 0) }, User = u, Repository = r } });
}
return null;
}
Expand Down

0 comments on commit bc8becf

Please sign in to comment.