-
-
Notifications
You must be signed in to change notification settings - Fork 953
Commit a4bd856
author
committedAthos Ribeiro
Get system user id in a lazy manner
Calling getpass.getuser may lead to breakage in environments where there
is no entries in the /etc/passwd file for the current user.
Setting the environment variables for the git user configurations should
prevents GitPython from using values from /etc/passwd. However, doing so
will not prevent reading /etc/passwd and looking for an entry with the
current user UID.
This patch changes the behavior described above so GitPython will
perform a lazy evaluation of /etc/passwd, only doing so when the
environment variables for the git user configuration are not available.
Signed-off-by: Athos Ribeiro <athos@redhat.com>1 parent 0c6e670 commit a4bd856
2 files changed
+35
-5
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
582 | 582 |
| |
583 | 583 |
| |
584 | 584 |
| |
585 | - | ||
586 | - | ||
585 | + | ||
586 | + | ||
587 | + | ||
588 | + | ||
589 | + | ||
590 | + | ||
591 | + | ||
592 | + | ||
593 | + | ||
587 | 594 |
| |
588 | 595 |
| |
589 | 596 |
| |
| |||
592 | 599 |
| |
593 | 600 |
| |
594 | 601 |
| |
595 | - | ||
602 | + | ||
596 | 603 |
| |
597 | 604 |
| |
598 | - | ||
605 | + | ||
599 | 606 |
| |
600 | 607 |
| |
601 | 608 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4 | 4 |
| |
5 | 5 |
| |
6 | 6 |
| |
7 | + | ||
7 | 8 |
| |
8 | 9 |
| |
9 | 10 |
| |
10 | - | ||
11 | + | ||
11 | 12 |
| |
12 | 13 |
| |
13 | 14 |
| |
| |||
215 | 216 |
| |
216 | 217 |
| |
217 | 218 |
| |
219 | + | ||
220 | + | ||
221 | + | ||
222 | + | ||
223 | + | ||
224 | + | ||
225 | + | ||
226 | + | ||
227 | + | ||
228 | + | ||
229 | + | ||
230 | + | ||
231 | + | ||
232 | + | ||
233 | + | ||
234 | + | ||
235 | + | ||
236 | + | ||
237 | + | ||
238 | + | ||
239 | + | ||
240 | + | ||
218 | 241 |
| |
219 | 242 |
| |
220 | 243 |
| |
|
0 commit comments