summaryrefslogtreecommitdiff
path: root/builtin/add.c
diff options
context:
space:
mode:
authorRamsay Jones <ramsay@ramsayjones.plus.com>2017-08-09 00:51:23 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-08-09 17:14:45 (GMT)
commit1e22a9917b48809a1825f79c66e58e9b1b1da08a (patch)
treec34b5410f19a6918a96cbcaaf3c312400cbf9536 /builtin/add.c
parent610d55af0f082f6b866dc858e144c03d8ed4424c (diff)
downloadgit-1e22a9917b48809a1825f79c66e58e9b1b1da08a.zip
git-1e22a9917b48809a1825f79c66e58e9b1b1da08a.tar.gz
git-1e22a9917b48809a1825f79c66e58e9b1b1da08a.tar.bz2
builtin/add: add detail to a 'cannot chmod' error message
In addition to adding the missing newline, add the x-ecutable bit 'mode change' character to the error message. This message now has the same form as similar messages output by 'update-index'. Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/add.c')
-rw-r--r--builtin/add.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin/add.c b/builtin/add.c
index e8fb80b..3979b34 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -30,7 +30,7 @@ struct update_callback_data {
int add_errors;
};
-static void chmod_pathspec(struct pathspec *pathspec, int force_mode)
+static void chmod_pathspec(struct pathspec *pathspec, char flip)
{
int i;
@@ -40,8 +40,8 @@ static void chmod_pathspec(struct pathspec *pathspec, int force_mode)
if (pathspec && !ce_path_match(ce, pathspec, NULL))
continue;
- if (chmod_cache_entry(ce, force_mode) < 0)
- fprintf(stderr, "cannot chmod '%s'", ce->name);
+ if (chmod_cache_entry(ce, flip) < 0)
+ fprintf(stderr, "cannot chmod %cx '%s'\n", flip, ce->name);
}
}