feat: do not handle branch for non-git repos

This commit is contained in:
Denis Gukov 2022-03-31 11:13:02 +05:00
parent 7a6d5ff711
commit 0b823804ad
3 changed files with 4 additions and 4 deletions

View File

@ -115,7 +115,7 @@ func (r Repository) Validate() error {
return &ValidationError{"repository url can't be empty"}
}
if r.GitBranch == "" {
if r.GetType() != RepositoryLocal && r.GitBranch == "" {
return &ValidationError{"repository branch can't be empty"}
}

View File

@ -76,9 +76,9 @@
<v-text-field
v-model="item.git_branch"
label="Branch"
:rules="[v => !!v || 'Branch is required']"
:rules="[v => (!!v || type === 'local') || 'Branch is required']"
required
:disabled="formSaving"
:disabled="formSaving || type === 'local'"
></v-text-field>
<v-select

View File

@ -51,7 +51,7 @@
>
<template v-slot:item.git_url="{ item }">
{{ item.git_url }}
<code>{{ item.git_branch }}</code>
<code v-if="!item.git_url.startsWith('/')">{{ item.git_branch }}</code>
</template>
<template v-slot:item.ssh_key_id="{ item }">