Skip to content

Commit 0797f40

Browse files
committed
GitFlow: Error during work with local branches only #53
1 parent 21adbf8 commit 0797f40

File tree

3 files changed

+20
-15
lines changed

3 files changed

+20
-15
lines changed

TGit/Commands/GitFlowMenuCommands.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ private void InitCommand(object sender, EventArgs e)
7878
var versionTag = string.IsNullOrEmpty(flowDialog.GitConfig.TagPrefix) ? "\"\"" : flowDialog.GitConfig.TagPrefix;
7979

8080
/* 1. Add GitFlow config options
81-
* 2. Checkout develop branch (create if it doesn't exist, reset if it does)
82-
* 3. Push develop branch
83-
*/
81+
* 2. Checkout develop branch (create if it doesn't exist, reset if it does)
82+
* 3. Push develop branch
83+
*/
8484
var process = ProcessHelper.StartProcessGui(_dte, _envHelper,
8585
"cmd.exe",
8686
$"/c cd \"{_envHelper.GetSolutionDir()}\" && " +
@@ -118,7 +118,7 @@ private void StartFeatureCommand(object sender, EventArgs e)
118118
$"/c cd \"{_envHelper.GetSolutionDir()}\" && " +
119119
GitHelper.GetSshSetup(_envHelper) +
120120
FormatCliCommand($"checkout {flowOptions.DevelopBranch}") +
121-
FormatCliCommand("pull") +
121+
(_options.PullChanges ? FormatCliCommand("pull") : string.Empty) +
122122
FormatCliCommand($"checkout -b {flowOptions.FeaturePrefix}{featureName} {flowOptions.DevelopBranch}", false),
123123
$"Starting feature {featureName}"
124124
);
@@ -139,7 +139,7 @@ private void StartFeatureGitHubCommand(object sender, EventArgs e)
139139
$"/c cd \"{_envHelper.GetSolutionDir()}\" && " +
140140
GitHelper.GetSshSetup(_envHelper) +
141141
FormatCliCommand("checkout master") +
142-
FormatCliCommand("pull") +
142+
(_options.PullChanges ? FormatCliCommand("pull") : string.Empty) +
143143
FormatCliCommand($"checkout -b {featureName} master", false),
144144
$"Starting feature {featureName}"
145145
);
@@ -164,7 +164,7 @@ private void FinishFeatureCommand(object sender, EventArgs e)
164164
$"/c cd \"{_envHelper.GetSolutionDir()}\" && " +
165165
GitHelper.GetSshSetup(_envHelper) +
166166
FormatCliCommand($"checkout {gitConfig.DevelopBranch}") +
167-
FormatCliCommand("pull") +
167+
(_options.PullChanges ? FormatCliCommand("pull") : string.Empty) +
168168
FormatCliCommand($"merge --no-ff {featureBranch}", false),
169169
$"Finishing feature {featureName}",
170170
featureBranch, null, _options, FormatCliCommand($"push origin {gitConfig.DevelopBranch}")
@@ -195,7 +195,7 @@ private void FinishFeatureGitHubCommand(object sender, EventArgs e)
195195
$"/c cd \"{_envHelper.GetSolutionDir()}\" && " +
196196
GitHelper.GetSshSetup(_envHelper) +
197197
FormatCliCommand("checkout master") +
198-
FormatCliCommand("pull") +
198+
(_options.PullChanges ? FormatCliCommand("pull") : string.Empty) +
199199
FormatCliCommand($"merge --no-ff {featureBranch}", false),
200200
$"Finishing feature {featureName}",
201201
featureBranch, null, _options, FormatCliCommand("push origin master"));
@@ -218,7 +218,7 @@ private void StartReleaseCommand(object sender, EventArgs e)
218218
$"/c cd \"{_envHelper.GetSolutionDir()}\" && " +
219219
GitHelper.GetSshSetup(_envHelper) +
220220
FormatCliCommand($"checkout {flowOptions.DevelopBranch}") +
221-
FormatCliCommand("pull") +
221+
(_options.PullChanges ? FormatCliCommand("pull") : string.Empty) +
222222
FormatCliCommand($"checkout -b {flowOptions.ReleasePrefix}{releaseVersion} {flowOptions.DevelopBranch}", false),
223223
$"Starting release {releaseVersion}"
224224
);
@@ -249,11 +249,11 @@ private void FinishReleaseCommand(object sender, EventArgs e)
249249
$"/c cd \"{_envHelper.GetSolutionDir()}\" && " +
250250
GitHelper.GetSshSetup(_envHelper) +
251251
FormatCliCommand($"checkout {gitConfig.MasterBranch}") +
252-
FormatCliCommand("pull") +
252+
(_options.PullChanges ? FormatCliCommand("pull") : string.Empty) +
253253
FormatCliCommand($"merge --no-ff {releaseBranch}") +
254254
FormatCliCommand($"tag {gitConfig.TagPrefix}{releaseName}") +
255255
FormatCliCommand($"checkout {gitConfig.DevelopBranch}") +
256-
FormatCliCommand("pull") +
256+
(_options.PullChanges ? FormatCliCommand("pull") : string.Empty) +
257257
FormatCliCommand($"merge --no-ff {releaseBranch}", false),
258258
$"Finishing release {releaseName}",
259259
releaseBranch, null, _options,
@@ -280,7 +280,7 @@ private void StartHotfixCommand(object sender, EventArgs e)
280280
$"/c cd \"{_envHelper.GetSolutionDir()}\" && " +
281281
GitHelper.GetSshSetup(_envHelper) +
282282
FormatCliCommand($"checkout {flowOptions.MasterBranch}") +
283-
FormatCliCommand("pull") +
283+
(_options.PullChanges ? FormatCliCommand("pull") : string.Empty) +
284284
FormatCliCommand($"checkout -b {flowOptions.HotfixPrefix}{hotfixVersion} {flowOptions.MasterBranch}", false),
285285
$"Starting hotfix {hotfixVersion}"
286286
);
@@ -311,11 +311,11 @@ private void FinishHotfixCommand(object sender, EventArgs e)
311311
$"/c cd \"{_envHelper.GetSolutionDir()}\" && " +
312312
GitHelper.GetSshSetup(_envHelper) +
313313
FormatCliCommand($"checkout {gitConfig.MasterBranch}") +
314-
FormatCliCommand("pull") +
314+
(_options.PullChanges ? FormatCliCommand("pull") : string.Empty) +
315315
FormatCliCommand($"merge --no-ff {hotfixBranch}") +
316316
FormatCliCommand($"tag {gitConfig.TagPrefix}{hotfixName}") +
317317
FormatCliCommand($"checkout {gitConfig.DevelopBranch}") +
318-
FormatCliCommand("pull") +
318+
(_options.PullChanges ? FormatCliCommand("pull") : string.Empty) +
319319
FormatCliCommand($"merge --no-ff {hotfixBranch}", false),
320320
$"Finishing hotfix {hotfixName}",
321321
hotfixBranch, null, _options,

TGit/OptionsGeneral.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ public class OptionPageGrid : DialogPage
3434
[Description("When finishing a feature push the changes to the remote by default")]
3535
public bool PushChanges { get; set; }
3636

37+
[Category("TGit")]
38+
[DisplayName(@"Pull changes")]
39+
[Description("When starting/finishing a feature pull the changes from the remote by default")]
40+
public bool PullChanges { get; set; } = true;
41+
3742
[Category("TGit")]
3843
[DisplayName(@"Default bug id")]
3944
[Description("$(BranchName), $(FeatureName), https://msdn.microsoft.com/en-us/library/c02as0cs.aspx")]

azure-pipelines.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ trigger:
1010
branches:
1111
include:
1212
- master
13-
# tags: none
13+
- release/*
1414

1515
variables:
1616
patch: $[counter('versioncounter', 41)]
1717
solution: '**/*.sln'
1818
buildPlatform: 'Any CPU'
1919
buildConfiguration: 'Release'
2020

21-
name: 4.10.$(patch)
21+
name: 4.11.$(patch)
2222

2323
steps:
2424
- task: NuGetToolInstaller@0

0 commit comments

Comments
 (0)