worktree: teach 'move' to override lock when --force given twice
[gitweb.git] / builtin / branch.c
index 4fc55c3508c2fff3e92e6235ed35ba582caf4b15..bbd006aab4b4798b7e86530fe3562c753e879bc1 100644 (file)
@@ -74,6 +74,14 @@ define_list_config_array(color_branch_slots);
 static int git_branch_config(const char *var, const char *value, void *cb)
 {
        const char *slot_name;
+       struct ref_sorting **sorting_tail = (struct ref_sorting **)cb;
+
+       if (!strcmp(var, "branch.sort")) {
+               if (!value)
+                       return config_error_nonbool(var);
+               parse_ref_sorting(sorting_tail, value);
+               return 0;
+       }
 
        if (starts_with(var, "column."))
                return git_column_config(var, value, "branch", &colopts);
@@ -653,7 +661,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
        if (argc == 2 && !strcmp(argv[1], "-h"))
                usage_with_options(builtin_branch_usage, options);
 
-       git_config(git_branch_config, NULL);
+       git_config(git_branch_config, sorting_tail);
 
        track = git_branch_track;