]> git.ipfire.org Git - thirdparty/git.git/blobdiff - rebase-interactive.c
dir.h: move DTYPE defines from cache.h
[thirdparty/git.git] / rebase-interactive.c
index 87649d0c016a371f83710a04140909d54a553aa7..789f40736176e5f597f79d35582224ac8830495e 100644 (file)
@@ -1,11 +1,16 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "commit.h"
+#include "editor.h"
+#include "environment.h"
+#include "gettext.h"
 #include "sequencer.h"
 #include "rebase-interactive.h"
 #include "strbuf.h"
 #include "commit-slab.h"
 #include "config.h"
 #include "dir.h"
+#include "object-name.h"
+#include "wrapper.h"
 
 static const char edit_todo_list_advice[] =
 N_("You can fix this with 'git rebase --edit-todo' "
@@ -54,9 +59,12 @@ void append_todo_help(int command_count,
 "l, label <label> = label current HEAD with a name\n"
 "t, reset <label> = reset HEAD to a label\n"
 "m, merge [-C <commit> | -c <commit>] <label> [# <oneline>]\n"
-".       create a merge commit using the original merge commit's\n"
-".       message (or the oneline, if no original merge commit was\n"
-".       specified); use -c <commit> to reword the commit message\n"
+"        create a merge commit using the original merge commit's\n"
+"        message (or the oneline, if no original merge commit was\n"
+"        specified); use -c <commit> to reword the commit message\n"
+"u, update-ref <ref> = track a placeholder for the <ref> to be updated\n"
+"                      to this position in the new commits. The <ref> is\n"
+"                      updated at the end of the rebase\n"
 "\n"
 "These lines can be re-ordered; they are executed from top to bottom.\n");
        unsigned edit_todo = !(shortrevisions && shortonto);
@@ -143,6 +151,12 @@ int edit_todo_list(struct repository *r, struct todo_list *todo_list,
                return -4;
        }
 
+       /*
+        * See if branches need to be added or removed from the update-refs
+        * file based on the new todo list.
+        */
+       todo_list_filter_update_refs(r, new_todo);
+
        return 0;
 }
 
@@ -178,7 +192,7 @@ int todo_list_check(struct todo_list *old_todo, struct todo_list *new_todo)
                struct commit *commit = item->commit;
                if (commit && !*commit_seen_at(&commit_seen, commit)) {
                        strbuf_addf(&missing, " - %s %.*s\n",
-                                   find_unique_abbrev(&commit->object.oid, DEFAULT_ABBREV),
+                                   repo_find_unique_abbrev(the_repository, &commit->object.oid, DEFAULT_ABBREV),
                                    item->arg_len,
                                    todo_item_get_arg(old_todo, item));
                        *commit_seen_at(&commit_seen, commit) = 1;