@@ -92,6 +92,7 @@ KeyValuePair<string, BranchConfig> GetBranchConfiguration(Branch currentBranch)
92
92
93
93
KeyValuePair < string , BranchConfig > InheritBranchConfiguration ( Branch currentBranch , KeyValuePair < string , BranchConfig > keyValuePair , BranchConfig branchConfiguration )
94
94
{
95
+ Logger . WriteInfo ( "Attempting to inherit branch configuration from parent branch" ) ;
95
96
var excludedBranches = new Branch [ 0 ] ;
96
97
// Check if we are a merge commit. If so likely we are a pull request
97
98
var parentCount = CurrentCommit . Parents . Count ( ) ;
@@ -112,6 +113,8 @@ KeyValuePair<string, BranchConfig> InheritBranchConfiguration(Branch currentBran
112
113
{
113
114
currentBranch = Repository . Branches . SingleOrDefault ( b => ! b . IsRemote && b . Tip == parents [ 0 ] ) ?? currentBranch ;
114
115
}
116
+
117
+ Logger . WriteInfo ( "HEAD is merge commit, this is likely a pull request using " + currentBranch . Name + " as base" ) ;
115
118
}
116
119
117
120
var branchPoint = currentBranch . FindCommitBranchWasBranchedFrom ( Repository , OnlyEvaluateTrackedBranches , excludedBranches ) ;
@@ -133,6 +136,8 @@ KeyValuePair<string, BranchConfig> InheritBranchConfiguration(Branch currentBran
133
136
. ToList ( ) ;
134
137
}
135
138
139
+ Logger . WriteInfo ( "Found possible parent branches: " + string . Join ( ", " , possibleParents . Select ( p => p . Name ) ) ) ;
140
+
136
141
// If it comes down to master and something, master is always first so we pick other branch
137
142
if ( possibleParents . Count == 2 && possibleParents . Any ( p => p . Name == "master" ) )
138
143
{
@@ -149,7 +154,10 @@ KeyValuePair<string, BranchConfig> InheritBranchConfiguration(Branch currentBran
149
154
} ) ;
150
155
}
151
156
152
- throw new Exception ( "Failed to inherit Increment branch configuration" ) ;
157
+ if ( possibleParents . Count == 0 )
158
+ throw new Exception ( "Failed to inherit Increment branch configuration, no branches found" ) ;
159
+
160
+ throw new Exception ( "Failed to inherit Increment branch configuration, ended up with: " + string . Join ( ", " , possibleParents . Select ( p => p . Name ) ) ) ;
153
161
}
154
162
155
163
static IEnumerable < Branch > ListBranchesContaininingCommit ( IRepository repo , string commitSha , Branch [ ] excludedBranches )
0 commit comments