File tree Expand file tree Collapse file tree 4 files changed +9
-0
lines changed
Expand file tree Collapse file tree 4 files changed +9
-0
lines changed Original file line number Diff line number Diff line change 180180 ${REPO} Repository's path
181181 ${DIRNAME} - repository's directory name;
182182 ${REMOTE} Selected remote or selected branch's remote
183+ ${CURRENT_BRANCH} - current branch;
183184 ${BRANCH} Selected branch, without ${REMOTE} part for remote branches
184185 ${BRANCH_FRIENDLY_NAME} Friendly name of selected branch, contains ${REMOTE} part for remote branches
185186 ${SHA} Selected commit's hash
Original file line number Diff line number Diff line change 183183
184184 ${REPO} 仓库路径
185185 ${DIRNAME} 仓库文件夹名
186+ ${CURRENT_BRANCH} 当前的分支
186187 ${REMOTE} 选中的远程仓库或选中分支所属的远程仓库
187188 ${BRANCH} 选中的分支,对于远程分支不包含远程名
188189 ${BRANCH_FRIENDLY_NAME} 选中的分支,对于远程分支包含远程名
Original file line number Diff line number Diff line change 183183
184184 ${REPO} 存放庫路徑
185185 ${DIRNAME} 存放庫資料夾名
186+ ${CURRENT_BRANCH} 當前分支
186187 ${REMOTE} 所選的遠端存放庫或所選分支的遠端
187188 ${BRANCH} 所選的分支。對於遠端分支,不包含遠端名稱
188189 ${BRANCH_FRIENDLY_NAME} 所選的分支。對於遠端分支,不包含遠端名稱
Original file line number Diff line number Diff line change @@ -180,6 +180,7 @@ private string PrepareStringByTarget(string org)
180180 {
181181 org = org . Replace ( "${REPO}" , GetWorkdir ( ) ) ;
182182 org = org . Replace ( "${DIRNAME}" , GetWorkdirname ( ) ) ;
183+ org = org . Replace ( "${CURRENT_BRANCH}" , GetCurrentBranch ( ) ) ;
183184
184185 return Target switch
185186 {
@@ -201,6 +202,11 @@ private string GetWorkdirname()
201202 return _repo . FullPath . Replace ( "\\ " , "/" ) . Split ( '/' ) [ ^ 1 ] ;
202203 }
203204
205+ private string GetCurrentBranch ( )
206+ {
207+ return _repo . CurrentBranch ? . FriendlyName ?? string . Empty ;
208+ }
209+
204210 private void Run ( string args )
205211 {
206212 var start = new ProcessStartInfo ( ) ;
You can’t perform that action at this time.
0 commit comments