tests: Introduce test_seq
[git.git] / wrapper.c
index 6ccd0595f43d0ef62bd60a5863804f9a842a4235..b5e33e49c77bdf1d19292971b63ff5221b013f33 100644 (file)
--- a/wrapper.c
+++ b/wrapper.c
@@ -402,3 +402,15 @@ int remove_or_warn(unsigned int mode, const char *file)
 {
        return S_ISGITLINK(mode) ? rmdir_or_warn(file) : unlink_or_warn(file);
 }
+
+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;
+}