Skip to content

Commit

Permalink
Issue #194: fix error message when deleting branch
Browse files Browse the repository at this point in the history
  • Loading branch information
davidebbo committed Apr 18, 2012
1 parent 58bc7b4 commit 2ef3877
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Kudu.Core/SourceControl/Git/GitDeploymentRepository.cs
Expand Up @@ -60,6 +60,14 @@ public PushInfo GetPushInfo()
{ {
string oldId = pushDetails[0]; string oldId = pushDetails[0];
string newId = pushDetails[1]; string newId = pushDetails[1];

// When a branch gets deleted, the newId is an all-zero string.
// In those cases, we never want to do anything, so return null
if (newId.Trim('0').Length == 0)
{
return null;
}

string reference = pushDetails[2]; string reference = pushDetails[2];
string branch = reference.Split('/').Last().Trim(); string branch = reference.Split('/').Last().Trim();
string fullNewId = _repository.Resolve(branch); string fullNewId = _repository.Resolve(branch);
Expand Down

0 comments on commit 2ef3877

Please sign in to comment.