Commit Graph

61 Commits

Author SHA1 Message Date
nulltoken
3e82d6c6f0 revparse: unfound reference return ENOTFOUND 2012-07-07 12:16:15 +02:00
nulltoken
b8460c2015 revparse: do not segfault when retrieving the last entry 2012-07-07 12:16:14 +02:00
nulltoken
e727938112 revparse: fix disambiguation of refs 2012-07-07 12:16:13 +02:00
nulltoken
805c81594d revparse: unfound previous head return ENOTFOUND 2012-07-07 12:16:12 +02:00
nulltoken
6a5136e538 revparse: only allow decimal reflog ordinal specs
passing 0 to git_strol(32|64) let the implementation guess if it's
dealing with an octal number or a decimal one.

Let's make it safe and ensure that both 'HEAD@{010}' and 'HEAD@{10}'
point at the same commit.
2012-07-07 12:16:10 +02:00
nulltoken
29f72aa638 revparse: leverage git__isdigit() 2012-07-07 12:16:09 +02:00
nulltoken
cab65c2b23 revparse: detect incorrect "refname@{-n}" syntax 2012-07-07 12:16:08 +02:00
nulltoken
494ae940a0 revparse: fix parsing of date specifiers 2012-07-02 19:56:41 +02:00
nulltoken
52b938d55a revparse: unfound reflog entry returns ENOTFOUND 2012-06-29 17:23:18 +02:00
nulltoken
08ac23a5fd revparse: unfound reflog ref returns ENOTFOUND 2012-06-29 17:23:10 +02:00
nulltoken
4de89ce72a revparse: unfound partially-named ref returns ENOTFOUND 2012-06-29 17:22:43 +02:00
nulltoken
0e7af9e758 revparse: unfound nth parent returns ENOTFOUND 2012-06-28 19:12:42 +02:00
nulltoken
0d23c62c48 revparse: handle specs with caret and colon 2012-06-28 19:12:41 +02:00
nulltoken
5b68ba7e15 revparse: unfound treepath returns ENOTFOUND 2012-06-28 19:12:40 +02:00
nulltoken
faaa7c517c revparse: return trees through the "colon" syntax 2012-06-28 19:12:40 +02:00
nulltoken
e28dd29b6e revparse: replace spaces with tabs 2012-06-28 19:12:39 +02:00
Ben Straub
a15e7f8621 Fix indentation. 2012-06-19 21:12:04 -07:00
Ben Straub
eb6bc45f6d Avoid uninitialized variable error. 2012-06-19 21:11:48 -07:00
Carlos Martín Nieto
cdca82c784 Plug a few leaks 2012-06-20 00:46:34 +02:00
Carlos Martín Nieto
053b509668 revparse: handle a non-existent path in the colon syntax
oid_for_tree_path may not always find the path in the tree, in which
case we need to return an error. The current code doesn't do this and
results in undefined behavior.
2012-06-19 23:47:17 +02:00
Ben Straub
2c90145aad Fix potential segfault in revparse. 2012-06-19 09:25:55 -07:00
Vicent Marti
8c4c357f18 clar: Fix warnings 2012-06-19 02:43:36 +02:00
Michael Schubert
c073459371 revparse: remove unnecessary GIT_BEGIN_DECL 2012-06-12 11:34:01 +02:00
Vicent Martí
3f0358604e misc: Fix warnings from PVS Studio trial 2012-06-07 22:43:48 +02:00
Ben Straub
763b838152 Fixing rev-parse-induced Travis errors. 2012-06-07 13:22:50 -07:00
Ben Straub
327dc61f13 Prefer git__free (again). 2012-06-07 12:28:08 -07:00
Ben Straub
31dda64716 Rename internal function. 2012-06-07 12:16:39 -07:00
Ben Straub
1a728066c3 Remove 'git__' prefix from a static function. 2012-06-06 13:04:08 -07:00
Ben Straub
d6391a626f Rev-parse: stop referencing freed memory.
Converted an internal utility to return an oid, 
rather than a tree entry (whose lifetime is tied
to the parent tree, which was freed before 
returning).
2012-06-06 13:00:12 -07:00
Ben Straub
19d35d528c Prefer git__free() to free(). 2012-06-06 12:31:48 -07:00
Ben Straub
8a385c0482 Move git__date_parse declaration to util.h. 2012-06-06 12:25:22 -07:00
Ben Straub
2c2cde47b8 Fix signatures for tree calls. 2012-06-06 08:41:39 -07:00
Ben Straub
734efe4b8e Rev-parse: implement ":/foo" syntax. 2012-06-01 14:18:52 -07:00
Ben Straub
b183a92fc2 Rev-parse: Plug memory leaks. 2012-05-31 13:42:58 -07:00
Ben Straub
244d2f6b80 Rev-parse: add "tag:README" syntax. 2012-05-30 16:52:11 -07:00
Ben Straub
dd9e4abc1b Approxidate: use libgit2 naming/calling conventions.
Also use git_time_t (64-bit integer) for time
values, although the 2038 problem is still present
on 32-bit machines.
2012-05-30 11:46:42 -07:00
Ben Straub
1ce4cc0164 Fix date.c build in msvc.
Ported the win32 implementations of gmtime_r,
localtime_r, and gettimeofday to be part of the 
posix compatibility layer, and fixed
git_signature_now to use them.
2012-05-15 15:41:05 -07:00
Ben Straub
72b86bae50 Rev-parse: better error handling for chaining.
Fixed an error where "nonexistant^N" or similar
would fall into an assert. This now properly returns
an error.
2012-05-11 11:58:02 -07:00
Ben Straub
94952ded3a Rev-parse: proper error checking. 2012-05-11 11:35:50 -07:00
Ben Straub
7e79d389a4 Rev-parse: regex check for "git describe" output. 2012-05-11 11:35:50 -07:00
Ben Straub
b41384b473 Plugging memory leak. 2012-05-11 11:35:50 -07:00
Ben Straub
c8a33547a0 Rev-parse: now capturing and reporting regex errors. 2012-05-11 11:35:50 -07:00
Ben Straub
2b35c45f1b Rev-parse: now @{-N} syntax searches in the right direction! 2012-05-11 11:35:50 -07:00
Ben Straub
46c2ead05d Now properly handling branches with "-g" in their names. 2012-05-11 11:35:50 -07:00
Ben Straub
ec6a632a1b Simplifying revparse_lookup_fully_qualified_ref. 2012-05-11 11:35:50 -07:00
Ben Straub
a346992f7e Rev-parse: @{time} syntax.
Ported date.c (for approxidate_careful) from git.git
revision aa39b85. Trimmed out the parts we're not
using.
2012-05-11 11:35:50 -07:00
Ben Straub
886f183ac3 Rev-parse: "ref^{/regex}" syntax. 2012-05-11 11:31:30 -07:00
Ben Straub
bae780e084 Rev-parse: fixing double-freeing. Thanks, Visual Studio! 2012-05-11 11:31:30 -07:00
Ben Straub
a6346302e6 Rev-parse: "ref@{upstream}" syntax.
Added tracking configuration to the test repo's
config to support unit tests.
2012-05-11 11:30:47 -07:00
Ben Straub
65bc26d54a Fixed last 2 memory leaks in rev-parse. 2012-05-11 11:30:46 -07:00