summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
Diffstat (limited to 'builtin')
-rw-r--r--builtin/rebase.c49
1 files changed, 0 insertions, 49 deletions
diff --git a/builtin/rebase.c b/builtin/rebase.c
index ae345c9e57..08b89869b3 100644
--- a/builtin/rebase.c
+++ b/builtin/rebase.c
@@ -1274,55 +1274,6 @@ static int check_exec_cmd(const char *cmd)
return 0;
}
-static void create_autostash(struct repository *r, const char *path,
- const char *default_reflog_action)
-{
- struct strbuf buf = STRBUF_INIT;
- struct lock_file lock_file = LOCK_INIT;
- int fd;
-
- fd = repo_hold_locked_index(r, &lock_file, 0);
- refresh_index(r->index, REFRESH_QUIET, NULL, NULL, NULL);
- if (0 <= fd)
- repo_update_index_if_able(r, &lock_file);
- rollback_lock_file(&lock_file);
-
- if (has_unstaged_changes(r, 1) ||
- has_uncommitted_changes(r, 1)) {
- struct child_process stash = CHILD_PROCESS_INIT;
- struct object_id oid;
-
- argv_array_pushl(&stash.args,
- "stash", "create", "autostash", NULL);
- stash.git_cmd = 1;
- stash.no_stdin = 1;
- strbuf_reset(&buf);
- if (capture_command(&stash, &buf, GIT_MAX_HEXSZ))
- die(_("Cannot autostash"));
- strbuf_trim_trailing_newline(&buf);
- if (get_oid(buf.buf, &oid))
- die(_("Unexpected stash response: '%s'"),
- buf.buf);
- strbuf_reset(&buf);
- strbuf_add_unique_abbrev(&buf, &oid, DEFAULT_ABBREV);
-
- if (safe_create_leading_directories_const(path))
- die(_("Could not create directory for '%s'"),
- path);
- write_file(path, "%s", oid_to_hex(&oid));
- printf(_("Created autostash: %s\n"), buf.buf);
- if (reset_head(r, NULL, "reset --hard",
- NULL, RESET_HEAD_HARD, NULL, NULL,
- default_reflog_action) < 0)
- die(_("could not reset --hard"));
-
- if (discard_index(r->index) < 0 ||
- repo_read_index(r) < 0)
- die(_("could not read index"));
- }
- strbuf_release(&buf);
-}
-
int cmd_rebase(int argc, const char **argv, const char *prefix)
{
struct rebase_options options = REBASE_OPTIONS_INIT;