forked from enlightenment/edi
scm_git: Allow us to unstage even if there is no remote url.
This allows us to use edi_scm fully even if the repo has no remote url. Otherwise business as usual.
This commit is contained in:
parent
8b5fc090f8
commit
8fafc6c00a
|
@ -106,7 +106,16 @@ _edi_scm_git_file_unstage(const char *path)
|
|||
int code;
|
||||
Eina_Strbuf *command = eina_strbuf_new();
|
||||
|
||||
eina_strbuf_append_printf(command, "git reset HEAD %s", path);
|
||||
eina_strbuf_append_printf(command, "git remote get-url origin");
|
||||
|
||||
code = _edi_scm_exec(eina_strbuf_string_get(command));
|
||||
|
||||
eina_strbuf_reset(command);
|
||||
|
||||
if (code == 0)
|
||||
eina_strbuf_append_printf(command, "git reset HEAD %s", path);
|
||||
else
|
||||
eina_strbuf_append_printf(command, "git rm --cached %s", path);
|
||||
|
||||
code = _edi_scm_exec(eina_strbuf_string_get(command));
|
||||
|
||||
|
|
Loading…
Reference in New Issue