mirror of
https://github.com/semaphoreui/semaphore.git
synced 2024-11-24 22:06:43 +01:00
feat: do not handle branch for non-git repos
This commit is contained in:
parent
7a6d5ff711
commit
0b823804ad
@ -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"}
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -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 }">
|
||||
|
Loading…
Reference in New Issue
Block a user