Skip to content

Commit 515cc01

Browse files
committed
Merge branch 'maint'
* maint: for-each-ref: fix objectname:short bug tree-walk: Correct bitrotted comment about tree_entry() Fix 'git log' early pager startup error case
2 parents b5442ca + ea16a03 commit 515cc01

File tree

4 files changed

+10
-11
lines changed

4 files changed

+10
-11
lines changed

builtin/for-each-ref.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,8 @@ static void grab_common_values(struct atom_value *val, int deref, struct object
228228
v->s = s;
229229
}
230230
else if (!strcmp(name, "objectname:short")) {
231-
v->s = find_unique_abbrev(obj->sha1, DEFAULT_ABBREV);
231+
v->s = xstrdup(find_unique_abbrev(obj->sha1,
232+
DEFAULT_ABBREV));
232233
}
233234
}
234235
}

builtin/log.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix,
125125
rev->show_decorations = 1;
126126
load_ref_decorations(decoration_style);
127127
}
128+
setup_pager();
128129
}
129130

130131
/*
@@ -491,12 +492,6 @@ int cmd_log_reflog(int argc, const char **argv, const char *prefix)
491492
rev.use_terminator = 1;
492493
rev.always_show_header = 1;
493494

494-
/*
495-
* We get called through "git reflog", so unlike the other log
496-
* routines, we need to set up our pager manually..
497-
*/
498-
setup_pager();
499-
500495
return cmd_log_walk(&rev);
501496
}
502497

git.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ static void handle_internal_command(int argc, const char **argv)
337337
{ "index-pack", cmd_index_pack },
338338
{ "init", cmd_init_db },
339339
{ "init-db", cmd_init_db },
340-
{ "log", cmd_log, RUN_SETUP | USE_PAGER },
340+
{ "log", cmd_log, RUN_SETUP },
341341
{ "ls-files", cmd_ls_files, RUN_SETUP },
342342
{ "ls-tree", cmd_ls_tree, RUN_SETUP },
343343
{ "ls-remote", cmd_ls_remote },
@@ -381,7 +381,7 @@ static void handle_internal_command(int argc, const char **argv)
381381
{ "send-pack", cmd_send_pack, RUN_SETUP },
382382
{ "shortlog", cmd_shortlog, USE_PAGER },
383383
{ "show-branch", cmd_show_branch, RUN_SETUP },
384-
{ "show", cmd_show, RUN_SETUP | USE_PAGER },
384+
{ "show", cmd_show, RUN_SETUP },
385385
{ "status", cmd_status, RUN_SETUP | NEED_WORK_TREE },
386386
{ "stripspace", cmd_stripspace },
387387
{ "symbolic-ref", cmd_symbolic_ref, RUN_SETUP },
@@ -396,7 +396,7 @@ static void handle_internal_command(int argc, const char **argv)
396396
{ "var", cmd_var },
397397
{ "verify-tag", cmd_verify_tag, RUN_SETUP },
398398
{ "version", cmd_version },
399-
{ "whatchanged", cmd_whatchanged, RUN_SETUP | USE_PAGER },
399+
{ "whatchanged", cmd_whatchanged, RUN_SETUP },
400400
{ "write-tree", cmd_write_tree, RUN_SETUP },
401401
{ "verify-pack", cmd_verify_pack },
402402
{ "show-ref", cmd_show_ref, RUN_SETUP },

tree-walk.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ static inline int tree_entry_len(const char *name, const unsigned char *sha1)
2828
void update_tree_entry(struct tree_desc *);
2929
void init_tree_desc(struct tree_desc *desc, const void *buf, unsigned long size);
3030

31-
/* Helper function that does both of the above and returns true for success */
31+
/*
32+
* Helper function that does both tree_entry_extract() and update_tree_entry()
33+
* and returns true for success
34+
*/
3235
int tree_entry(struct tree_desc *, struct name_entry *);
3336

3437
void *fill_tree_descriptor(struct tree_desc *desc, const unsigned char *sha1);

0 commit comments

Comments
 (0)