@@ -5,24 +5,6 @@ namespace SourceGit.Commands
5
5
{
6
6
public static class Branch
7
7
{
8
- public static string ShowCurrent ( string repo )
9
- {
10
- var cmd = new Command ( ) ;
11
- cmd . WorkingDirectory = repo ;
12
- cmd . Context = repo ;
13
- cmd . Args = "branch --show-current" ;
14
- return cmd . ReadToEnd ( ) . StdOut . Trim ( ) ;
15
- }
16
-
17
- public static async Task < string > ShowCurrentAsync ( string repo )
18
- {
19
- var cmd = new Command ( ) ;
20
- cmd . WorkingDirectory = repo ;
21
- cmd . Context = repo ;
22
- cmd . Args = "branch --show-current" ;
23
- return ( await cmd . ReadToEndAsync ( ) ) . StdOut . Trim ( ) ;
24
- }
25
-
26
8
public static async Task < bool > CreateAsync ( string repo , string name , string basedOn , bool force , Models . ICommandLog log )
27
9
{
28
10
var builder = new StringBuilder ( ) ;
@@ -38,7 +20,7 @@ public static async Task<bool> CreateAsync(string repo, string name, string base
38
20
cmd . Context = repo ;
39
21
cmd . Args = builder . ToString ( ) ;
40
22
cmd . Log = log ;
41
- return await cmd . ExecAsync ( ) ;
23
+ return await cmd . ExecAsync ( ) . ConfigureAwait ( false ) ;
42
24
}
43
25
44
26
public static async Task < bool > RenameAsync ( string repo , string name , string to , Models . ICommandLog log )
@@ -48,7 +30,7 @@ public static async Task<bool> RenameAsync(string repo, string name, string to,
48
30
cmd . Context = repo ;
49
31
cmd . Args = $ "branch -M { name } { to } ";
50
32
cmd . Log = log ;
51
- return await cmd . ExecAsync ( ) ;
33
+ return await cmd . ExecAsync ( ) . ConfigureAwait ( false ) ;
52
34
}
53
35
54
36
public static async Task < bool > SetUpstreamAsync ( string repo , string name , string upstream , Models . ICommandLog log )
@@ -63,7 +45,7 @@ public static async Task<bool> SetUpstreamAsync(string repo, string name, string
63
45
else
64
46
cmd . Args = $ "branch { name } -u { upstream } ";
65
47
66
- return await cmd . ExecAsync ( ) ;
48
+ return await cmd . ExecAsync ( ) . ConfigureAwait ( false ) ;
67
49
}
68
50
69
51
public static async Task < bool > DeleteLocalAsync ( string repo , string name , Models . ICommandLog log )
@@ -73,21 +55,21 @@ public static async Task<bool> DeleteLocalAsync(string repo, string name, Models
73
55
cmd . Context = repo ;
74
56
cmd . Args = $ "branch -D { name } ";
75
57
cmd . Log = log ;
76
- return await cmd . ExecAsync ( ) ;
58
+ return await cmd . ExecAsync ( ) . ConfigureAwait ( false ) ;
77
59
}
78
60
79
61
public static async Task < bool > DeleteRemoteAsync ( string repo , string remote , string name , Models . ICommandLog log )
80
62
{
81
- bool exists = await new Remote ( repo ) . HasBranchAsync ( remote , name ) ;
63
+ bool exists = await new Remote ( repo ) . HasBranchAsync ( remote , name ) . ConfigureAwait ( false ) ;
82
64
if ( exists )
83
- return await new Push ( repo , remote , $ "refs/heads/{ name } ", true ) { Log = log } . ExecAsync ( ) ;
65
+ return await new Push ( repo , remote , $ "refs/heads/{ name } ", true ) { Log = log } . ExecAsync ( ) . ConfigureAwait ( false ) ;
84
66
85
67
var cmd = new Command ( ) ;
86
68
cmd . WorkingDirectory = repo ;
87
69
cmd . Context = repo ;
88
70
cmd . Args = $ "branch -D -r { remote } /{ name } ";
89
71
cmd . Log = log ;
90
- return await cmd . ExecAsync ( ) ;
72
+ return await cmd . ExecAsync ( ) . ConfigureAwait ( false ) ;
91
73
}
92
74
}
93
75
}
0 commit comments