Skip to content

Commit cd0f8e6

Browse files
committed
Merge branch 'maint'
* maint: help -a: do not unnecessarily look for a repository Do not try to remove directories when removing old links rebase -i: more graceful handling of invalid commands help -i: properly error out if no info viewer can be found
2 parents c1e01b0 + 7c3baa9 commit cd0f8e6

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1375,7 +1375,7 @@ SHELL = $(SHELL_PATH)
13751375

13761376
all:: shell_compatibility_test $(ALL_PROGRAMS) $(BUILT_INS) $(OTHER_PROGRAMS) GIT-BUILD-OPTIONS
13771377
ifneq (,$X)
1378-
$(QUIET_BUILT_IN)$(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), test '$p' -ef '$p$X' || $(RM) '$p';)
1378+
$(QUIET_BUILT_IN)$(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), test -d '$p' -o '$p' -ef '$p$X' || $(RM) '$p';)
13791379
endif
13801380

13811381
all::

builtin-help.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,7 @@ static void show_info_page(const char *git_cmd)
372372
const char *page = cmd_to_page(git_cmd);
373373
setenv("INFOPATH", system_path(GIT_INFO_PATH), 1);
374374
execlp("info", "info", "gitman", page, NULL);
375+
die("no info viewer handled the request");
375376
}
376377

377378
static void get_html_page_path(struct strbuf *page_path, const char *page)
@@ -416,9 +417,6 @@ int cmd_help(int argc, const char **argv, const char *prefix)
416417
const char *alias;
417418
load_command_list("git-", &main_cmds, &other_cmds);
418419

419-
setup_git_directory_gently(&nongit);
420-
git_config(git_help_config, NULL);
421-
422420
argc = parse_options(argc, argv, prefix, builtin_help_options,
423421
builtin_help_usage, 0);
424422

@@ -429,6 +427,9 @@ int cmd_help(int argc, const char **argv, const char *prefix)
429427
return 0;
430428
}
431429

430+
setup_git_directory_gently(&nongit);
431+
git_config(git_help_config, NULL);
432+
432433
if (!argv[0]) {
433434
printf("usage: %s\n\n", git_usage_string);
434435
list_common_cmds_help();

git-rebase--interactive.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,12 @@ do_next () {
416416
;;
417417
*)
418418
warn "Unknown command: $command $sha1 $rest"
419-
die_with_patch $sha1 "Please fix this in the file $TODO."
419+
if git rev-parse --verify -q "$sha1" >/dev/null
420+
then
421+
die_with_patch $sha1 "Please fix this in the file $TODO."
422+
else
423+
die "Please fix this in the file $TODO."
424+
fi
420425
;;
421426
esac
422427
test -s "$TODO" && return

0 commit comments

Comments
 (0)