summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 34df9ab)
raw | patch | inline | side by side (parent: 34df9ab)
author | Michael J Gruber <git@drmicha.warpmail.net> | |
Thu, 31 Mar 2011 09:17:34 +0000 (11:17 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 3 Apr 2011 19:24:27 +0000 (12:24 -0700) |
Currently, the "Did you mean..." message suggests "commit:fullpath"
only. Extend this to show the more convenient "commit:./file" form also.
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
only. Extend this to show the more convenient "commit:./file" form also.
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sha1_name.c | patch | blob | history | |
t/t1506-rev-parse-diagnosis.sh | patch | blob | history |
diff --git a/sha1_name.c b/sha1_name.c
index faea58dc8c27de23e8fbaff17b39cb9e57708510..69cd6c815d6bb43fdeda9c4b28fc138bed17c057 100644 (file)
--- a/sha1_name.c
+++ b/sha1_name.c
if (!get_tree_entry(tree_sha1, fullname,
sha1, &mode)) {
die("Path '%s' exists, but not '%s'.\n"
- "Did you mean '%s:%s'?",
+ "Did you mean '%s:%s' aka '%s:./%s'?",
fullname,
filename,
object_name,
- fullname);
+ fullname,
+ object_name,
+ filename);
}
die("Path '%s' does not exist in '%s'",
filename, object_name);
if (ce_namelen(ce) == fullnamelen &&
!memcmp(ce->name, fullname, fullnamelen))
die("Path '%s' is in the index, but not '%s'.\n"
- "Did you mean ':%d:%s'?",
+ "Did you mean ':%d:%s' aka ':%d:./%s'?",
fullname, filename,
- ce_stage(ce), fullname);
+ ce_stage(ce), fullname,
+ ce_stage(ce), filename);
}
if (!lstat(filename, &st))
index f9cb2021a7569b7e9674148e2c4f811901a7fb6c..4a6396f9e3fb8006969916e12066fa6fc1527b3d 100755 (executable)
test_did_you_mean ()
{
printf "fatal: Path '$2$3' $4, but not ${5:-'$3'}.\n" >expected &&
- printf "Did you mean '$1:$2$3'?\n" >>expected &&
+ printf "Did you mean '$1:$2$3'${2:+ aka '$1:./$3'}?\n" >>expected &&
test_cmp expected error
}