aboutsummaryrefslogtreecommitdiff
path: root/ident.c
diff options
context:
space:
mode:
Diffstat (limited to 'ident.c')
-rw-r--r--ident.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/ident.c b/ident.c
index 5ff1aadaa..d7c70e28d 100644
--- a/ident.c
+++ b/ident.c
@@ -23,6 +23,18 @@ static int author_ident_explicitly_given;
#define get_gecos(struct_passwd) ((struct_passwd)->pw_gecos)
#endif
+static struct passwd *xgetpwuid_self(void)
+{
+ struct passwd *pw;
+
+ errno = 0;
+ pw = getpwuid(getuid());
+ if (!pw)
+ die(_("unable to look up current user in the passwd file: %s"),
+ errno ? strerror(errno) : _("no such user"));
+ return pw;
+}
+
static void copy_gecos(const struct passwd *w, struct strbuf *name)
{
char *src;