diff options
| author | Junio C Hamano <gitster@pobox.com> | 2007-11-04 01:26:02 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2007-11-04 01:26:02 -0700 |
| commit | 02273fdbd07ddaa13a232db0ae63a720c4a013f0 (patch) | |
| tree | 714a6c735a550296c9edd073129d327feb7c87ce /git-compat-util.h | |
| parent | Merge branch 'ss/mailsplit' (diff) | |
| parent | cherry-pick/revert -m: add tests (diff) | |
| download | git-02273fdbd07ddaa13a232db0ae63a720c4a013f0.tar.gz git-02273fdbd07ddaa13a232db0ae63a720c4a013f0.zip | |
Merge branch 'jc/revert-merge'
* jc/revert-merge:
cherry-pick/revert -m: add tests
revert/cherry-pick: work on merge commits as well
Conflicts:
builtin-revert.c
Diffstat (limited to 'git-compat-util.h')
| -rw-r--r-- | git-compat-util.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/git-compat-util.h b/git-compat-util.h index 474f1d1ffb..7b29d1b905 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -381,4 +381,17 @@ static inline int strtoul_ui(char const *s, int base, unsigned int *result) return 0; } +static inline int strtol_i(char const *s, int base, int *result) +{ + long ul; + char *p; + + errno = 0; + ul = strtol(s, &p, base); + if (errno || *p || p == s || (int) ul != ul) + return -1; + *result = ul; + return 0; +} + #endif |
