summaryrefslogtreecommitdiffstats
path: root/setup.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-07-02 20:01:25 +0200
committerJunio C Hamano <gitster@pobox.com>2012-07-03 19:22:37 +0200
commit8c135ea260a84ef71899c8bd23bb39425288f9fe (patch)
treedbf61be43a0bb027ff1f02a5eea02e6f0bfc67fc /setup.c
parentsha1_name.c: hide get_sha1_with_context_1() ugliness (diff)
downloadgit-8c135ea260a84ef71899c8bd23bb39425288f9fe.tar.xz
git-8c135ea260a84ef71899c8bd23bb39425288f9fe.zip
sha1_name.c: get rid of get_sha1_with_mode_1()
The only external caller is setup.c that tries to give a nicer error message when an object name is misspelt (e.g. "HEAD:cashe.h"). Retire it and give the caller a dedicated and more intuitive API function maybe_die_on_misspelt_object_name(). Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'setup.c')
-rw-r--r--setup.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/setup.c b/setup.c
index 61c22e6bec..233bfbe920 100644
--- a/setup.c
+++ b/setup.c
@@ -55,18 +55,14 @@ int check_filename(const char *prefix, const char *arg)
static void NORETURN die_verify_filename(const char *prefix, const char *arg)
{
- unsigned char sha1[20];
- unsigned mode;
-
/*
* Saying "'(icase)foo' does not exist in the index" when the
* user gave us ":(icase)foo" is just stupid. A magic pathspec
* begins with a colon and is followed by a non-alnum; do not
- * let get_sha1_with_mode_1(only_to_die=1) to even trigger.
+ * let maybe_die_on_misspelt_object_name() even trigger.
*/
if (!(arg[0] == ':' && !isalnum(arg[1])))
- /* try a detailed diagnostic ... */
- get_sha1_with_mode_1(arg, sha1, &mode, 1, prefix);
+ maybe_die_on_misspelt_object_name(arg, prefix);
/* ... or fall back the most general message. */
die("ambiguous argument '%s': unknown revision or path not in the working tree.\n"