aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-03-20 15:53:30 -0700
committerJunio C Hamano <gitster@pobox.com>2012-03-20 15:53:30 -0700
commit0f360763c02d1230614e23f94fb298dab0162aa0 (patch)
tree3c4645bcc34807e9a63b904ea163cc73b8ddd970
parenta46034819ecce6872bff099f3d75589f4d38c00c (diff)
parentd4c813d47d5c4f821a6947a29e4a480ec6522f44 (diff)
downloadgit-0f360763c02d1230614e23f94fb298dab0162aa0.tar.gz
git-0f360763c02d1230614e23f94fb298dab0162aa0.tar.xz
Merge branch 'maint-1.7.8' into maint
* maint-1.7.8: t/Makefile: Use $(sort ...) explicitly where needed gitweb: Fix actionless dispatch for non-existent objects i18n of multi-line advice messages
-rw-r--r--advice.c23
-rw-r--r--builtin/revert.c9
-rwxr-xr-xgitweb/gitweb.perl4
-rw-r--r--t/Makefile6
-rwxr-xr-xt/t9500-gitweb-standalone-no-errors.sh8
5 files changed, 34 insertions, 16 deletions
diff --git a/advice.c b/advice.c
index e02e632df..65a07859f 100644
--- a/advice.c
+++ b/advice.c
@@ -21,11 +21,21 @@ static struct {
void advise(const char *advice, ...)
{
+ struct strbuf buf = STRBUF_INIT;
va_list params;
+ const char *cp, *np;
va_start(params, advice);
- vreportf("hint: ", advice, params);
+ strbuf_addf(&buf, advice, params);
va_end(params);
+
+ for (cp = buf.buf; *cp; cp = np) {
+ np = strchrnul(cp, '\n');
+ fprintf(stderr, _("hint: %.*s\n"), (int)(np - cp), cp);
+ if (*np)
+ np++;
+ }
+ strbuf_release(&buf);
}
int git_default_advice_config(const char *var, const char *value)
@@ -46,16 +56,15 @@ int git_default_advice_config(const char *var, const char *value)
int error_resolve_conflict(const char *me)
{
error("'%s' is not possible because you have unmerged files.", me);
- if (advice_resolve_conflict) {
+ if (advice_resolve_conflict)
/*
* Message used both when 'git commit' fails and when
* other commands doing a merge do.
*/
- advise("Fix them up in the work tree,");
- advise("and then use 'git add/rm <file>' as");
- advise("appropriate to mark resolution and make a commit,");
- advise("or use 'git commit -a'.");
- }
+ advise(_("Fix them up in the work tree,\n"
+ "and then use 'git add/rm <file>' as\n"
+ "appropriate to mark resolution and make a commit,\n"
+ "or use 'git commit -a'."));
return -1;
}
diff --git a/builtin/revert.c b/builtin/revert.c
index 0d8020cf6..df63794e0 100644
--- a/builtin/revert.c
+++ b/builtin/revert.c
@@ -343,11 +343,10 @@ static void print_advice(int show_hint)
return;
}
- if (show_hint) {
- advise("after resolving the conflicts, mark the corrected paths");
- advise("with 'git add <paths>' or 'git rm <paths>'");
- advise("and commit the result with 'git commit'");
- }
+ if (show_hint)
+ advise(_("after resolving the conflicts, mark the corrected paths\n"
+ "with 'git add <paths>' or 'git rm <paths>'\n"
+ "and commit the result with 'git commit'"));
}
static void write_message(struct strbuf *msgbuf, const char *filename)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index b9c33ba31..b67972ec5 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1132,8 +1132,10 @@ sub dispatch {
if (!defined $action) {
if (defined $hash) {
$action = git_get_type($hash);
+ $action or die_error(404, "Object does not exist");
} elsif (defined $hash_base && defined $file_name) {
$action = git_get_type("$hash_base:$file_name");
+ $action or die_error(404, "File or directory does not exist");
} elsif (defined $project) {
$action = 'summary';
} else {
@@ -2400,7 +2402,7 @@ sub get_feed_info {
return unless (defined $project);
# some views should link to OPML, or to generic project feed,
# or don't have specific feed yet (so they should use generic)
- return if ($action =~ /^(?:tags|heads|forks|tag|search)$/x);
+ return if (!$action || $action =~ /^(?:tags|heads|forks|tag|search)$/x);
my $branch;
# branches refs uses 'refs/heads/' prefix (fullname) to differentiate
diff --git a/t/Makefile b/t/Makefile
index 52a23fffc..b5048ab77 100644
--- a/t/Makefile
+++ b/t/Makefile
@@ -17,9 +17,9 @@ DEFAULT_TEST_TARGET ?= test
# Shell quote;
SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
-T = $(wildcard t[0-9][0-9][0-9][0-9]-*.sh)
-TSVN = $(wildcard t91[0-9][0-9]-*.sh)
-TGITWEB = $(wildcard t95[0-9][0-9]-*.sh)
+T = $(sort $(wildcard t[0-9][0-9][0-9][0-9]-*.sh))
+TSVN = $(sort $(wildcard t91[0-9][0-9]-*.sh))
+TGITWEB = $(sort $(wildcard t95[0-9][0-9]-*.sh))
all: $(DEFAULT_TEST_TARGET)
diff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb-standalone-no-errors.sh
index 858a649cb..90bb6050c 100755
--- a/t/t9500-gitweb-standalone-no-errors.sh
+++ b/t/t9500-gitweb-standalone-no-errors.sh
@@ -475,6 +475,14 @@ test_expect_success \
'gitweb_run "" "/.git/master:foo/"'
test_expect_success \
+ 'path_info: project/branch (non-existent)' \
+ 'gitweb_run "" "/.git/non-existent"'
+
+test_expect_success \
+ 'path_info: project/branch:filename (non-existent branch)' \
+ 'gitweb_run "" "/.git/non-existent:non-existent"'
+
+test_expect_success \
'path_info: project/branch:file (non-existent)' \
'gitweb_run "" "/.git/master:non-existent"'