Skip to content

Commit

Permalink
Merge branch 'maint'
Browse files Browse the repository at this point in the history
* maint:
  for-each-ref: fix objectname:short bug
  tree-walk: Correct bitrotted comment about tree_entry()
  Fix 'git log' early pager startup error case
  • Loading branch information
Junio C Hamano committed Aug 26, 2010
2 parents b5442ca + ea16a03 commit 515cc01
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
3 changes: 2 additions & 1 deletion builtin/for-each-ref.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,8 @@ static void grab_common_values(struct atom_value *val, int deref, struct object
v->s = s;
}
else if (!strcmp(name, "objectname:short")) {
v->s = find_unique_abbrev(obj->sha1, DEFAULT_ABBREV);
v->s = xstrdup(find_unique_abbrev(obj->sha1,
DEFAULT_ABBREV));
}
}
}
Expand Down
7 changes: 1 addition & 6 deletions builtin/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix,
rev->show_decorations = 1;
load_ref_decorations(decoration_style);
}
setup_pager();
}

/*
Expand Down Expand Up @@ -491,12 +492,6 @@ int cmd_log_reflog(int argc, const char **argv, const char *prefix)
rev.use_terminator = 1;
rev.always_show_header = 1;

/*
* We get called through "git reflog", so unlike the other log
* routines, we need to set up our pager manually..
*/
setup_pager();

return cmd_log_walk(&rev);
}

Expand Down
6 changes: 3 additions & 3 deletions git.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ static void handle_internal_command(int argc, const char **argv)
{ "index-pack", cmd_index_pack },
{ "init", cmd_init_db },
{ "init-db", cmd_init_db },
{ "log", cmd_log, RUN_SETUP | USE_PAGER },
{ "log", cmd_log, RUN_SETUP },
{ "ls-files", cmd_ls_files, RUN_SETUP },
{ "ls-tree", cmd_ls_tree, RUN_SETUP },
{ "ls-remote", cmd_ls_remote },
Expand Down Expand Up @@ -381,7 +381,7 @@ static void handle_internal_command(int argc, const char **argv)
{ "send-pack", cmd_send_pack, RUN_SETUP },
{ "shortlog", cmd_shortlog, USE_PAGER },
{ "show-branch", cmd_show_branch, RUN_SETUP },
{ "show", cmd_show, RUN_SETUP | USE_PAGER },
{ "show", cmd_show, RUN_SETUP },
{ "status", cmd_status, RUN_SETUP | NEED_WORK_TREE },
{ "stripspace", cmd_stripspace },
{ "symbolic-ref", cmd_symbolic_ref, RUN_SETUP },
Expand All @@ -396,7 +396,7 @@ static void handle_internal_command(int argc, const char **argv)
{ "var", cmd_var },
{ "verify-tag", cmd_verify_tag, RUN_SETUP },
{ "version", cmd_version },
{ "whatchanged", cmd_whatchanged, RUN_SETUP | USE_PAGER },
{ "whatchanged", cmd_whatchanged, RUN_SETUP },
{ "write-tree", cmd_write_tree, RUN_SETUP },
{ "verify-pack", cmd_verify_pack },
{ "show-ref", cmd_show_ref, RUN_SETUP },
Expand Down
5 changes: 4 additions & 1 deletion tree-walk.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ static inline int tree_entry_len(const char *name, const unsigned char *sha1)
void update_tree_entry(struct tree_desc *);
void init_tree_desc(struct tree_desc *desc, const void *buf, unsigned long size);

/* Helper function that does both of the above and returns true for success */
/*
* Helper function that does both tree_entry_extract() and update_tree_entry()
* and returns true for success
*/
int tree_entry(struct tree_desc *, struct name_entry *);

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

0 comments on commit 515cc01

Please sign in to comment.