Skip to content

Commit

Permalink
Merge pull request #158 from yplam/master
Browse files Browse the repository at this point in the history
fix: 当remote 删除当前分支后,刷新分支会失败
  • Loading branch information
littlehz committed Apr 12, 2016
2 parents 1c5271f + 0035a79 commit f53136a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/Git.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ public function updateToVersion(TaskModel $task) {
*/
public function getBranchList() {
$destination = Project::getDeployFromDir();
// 先更新,其实没有必要更新
///$this->updateRepo('master', $destination);
// 应该先更新,不然在remote git删除当前选中的分支后,获取分支列表会失败
$this->updateRepo('master', $destination);
$cmd[] = sprintf('cd %s ', $destination);
$cmd[] = '/usr/bin/env git pull -a';
$cmd[] = '/usr/bin/env git branch -a';
Expand Down
4 changes: 4 additions & 0 deletions views/task/submit-git.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ function getBranchList() {
$('#branch').html(select);
$('.get-branch').hide();
$('.show-tip').show();
if(data.data.length == 1){
$('#branch').change();
}

});
}

Expand Down

0 comments on commit f53136a

Please sign in to comment.