forked from enlightenment/edi
scm: make remote adding not overwrite previous remotes
Also set upstream tracking by default not fixing retrospectively
This commit is contained in:
parent
38e971647c
commit
9cf9fa415c
|
@ -374,10 +374,11 @@ _edi_settings_project_remote_cb(void *data EINA_UNUSED, Evas_Object *obj,
|
||||||
if (!url || strlen(url) == 0)
|
if (!url || strlen(url) == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!edi_scm_enabled())
|
if (!edi_scm_enabled() || edi_scm_remote_enabled())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
edi_scm_remote_add(elm_object_text_get(entry));
|
edi_scm_remote_add(elm_object_text_get(entry));
|
||||||
|
elm_object_disabled_set(entry, EINA_TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -504,7 +505,7 @@ _edi_settings_project_create(Evas_Object *parent)
|
||||||
|
|
||||||
entry_remote = elm_entry_add(hbox);
|
entry_remote = elm_entry_add(hbox);
|
||||||
elm_object_text_set(entry_remote, engine->remote_url);
|
elm_object_text_set(entry_remote, engine->remote_url);
|
||||||
|
elm_object_disabled_set(entry_remote, edi_scm_remote_enabled());
|
||||||
evas_object_size_hint_weight_set(entry_remote, 0.75, 0.0);
|
evas_object_size_hint_weight_set(entry_remote, 0.75, 0.0);
|
||||||
evas_object_size_hint_align_set(entry_remote, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
evas_object_size_hint_align_set(entry_remote, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
elm_box_pack_end(hbox, entry_remote);
|
elm_box_pack_end(hbox, entry_remote);
|
||||||
|
|
|
@ -152,22 +152,7 @@ _edi_scm_git_commit(const char *message)
|
||||||
static int
|
static int
|
||||||
_edi_scm_git_push(void)
|
_edi_scm_git_push(void)
|
||||||
{
|
{
|
||||||
int code;
|
return _edi_scm_exec("git push");
|
||||||
Eina_Strbuf *command = eina_strbuf_new();
|
|
||||||
|
|
||||||
eina_strbuf_append(command, "git push");
|
|
||||||
|
|
||||||
code = _edi_scm_exec(eina_strbuf_string_get(command));
|
|
||||||
if (code != 0)
|
|
||||||
{
|
|
||||||
eina_strbuf_reset(command);
|
|
||||||
eina_strbuf_append(command, "git push --set-upstream origin master");
|
|
||||||
code = _edi_scm_exec(eina_strbuf_string_get(command));
|
|
||||||
}
|
|
||||||
|
|
||||||
eina_strbuf_free(command);
|
|
||||||
|
|
||||||
return code;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -206,18 +191,14 @@ _edi_scm_git_remote_add(const char *remote_url)
|
||||||
int code;
|
int code;
|
||||||
Eina_Strbuf *command = eina_strbuf_new();
|
Eina_Strbuf *command = eina_strbuf_new();
|
||||||
|
|
||||||
eina_strbuf_append(command, "git remote rm origin");
|
|
||||||
|
|
||||||
code = _edi_scm_exec(eina_strbuf_string_get(command));
|
|
||||||
|
|
||||||
eina_strbuf_reset(command);
|
|
||||||
|
|
||||||
eina_strbuf_append_printf(command, "git remote add origin %s", remote_url);
|
eina_strbuf_append_printf(command, "git remote add origin %s", remote_url);
|
||||||
|
|
||||||
code = _edi_scm_exec(eina_strbuf_string_get(command));
|
code = _edi_scm_exec(eina_strbuf_string_get(command));
|
||||||
|
|
||||||
eina_strbuf_free(command);
|
eina_strbuf_free(command);
|
||||||
|
|
||||||
|
if (code == 0)
|
||||||
|
code = _edi_scm_exec("git push --set-upstream origin master");
|
||||||
|
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue