Skip to content

Commit 1e22a99

Browse files
ramsay-jonesgitster
authored andcommitted
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 <[email protected]> Reviewed-by: Jonathan Nieder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 610d55a commit 1e22a99

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

builtin/add.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ struct update_callback_data {
3030
int add_errors;
3131
};
3232

33-
static void chmod_pathspec(struct pathspec *pathspec, int force_mode)
33+
static void chmod_pathspec(struct pathspec *pathspec, char flip)
3434
{
3535
int i;
3636

@@ -40,8 +40,8 @@ static void chmod_pathspec(struct pathspec *pathspec, int force_mode)
4040
if (pathspec && !ce_path_match(ce, pathspec, NULL))
4141
continue;
4242

43-
if (chmod_cache_entry(ce, force_mode) < 0)
44-
fprintf(stderr, "cannot chmod '%s'", ce->name);
43+
if (chmod_cache_entry(ce, flip) < 0)
44+
fprintf(stderr, "cannot chmod %cx '%s'\n", flip, ce->name);
4545
}
4646
}
4747

0 commit comments

Comments
 (0)