Commit Graph

2734 Commits

Author SHA1 Message Date
Vicent Martí
8c6329eec9 Merge pull request #692 from nulltoken/fix/delete-branch_ENOTFOUND
branch: make git_branch_delete() return GIT_ENOTFOUND when the branch doesn't exist
2012-05-14 11:25:40 -07:00
Vicent Martí
c9e9ec97d2 Merge pull request #688 from hanwen/master
See issue https://github.com/libgit2/libgit2/issues/680
2012-05-14 11:24:37 -07:00
Sascha Cunz
1093e2de22 Specifiy dllimport to MSVC if we're not building libgit2.dll
Building a "shared object" (DLL) in Windows includes 2 steps:

- specify __declspec(dllexport)
  when building the library itself. MSVC will disallow itself from
  optimizing these symbols out and reference them in the PE's
  Exports-Table.
  Further, a static link library will be generated. This library
  contains the symbols which are exported via the declsepc above.
  The __declspec(dllexport) becomes part of the symbol-signature
  (like parameter types in C++ are 'mangled' into the symbol name,
  the export specifier is mingled with the name)

- specify __declspec(dllimport)
  when using the library. This again mingles the declspec into the
  name and declares the function / variable with external linkage.

cmake automatically adds -Dgit2_EXPORTS to the compiler arguments
when compiling the libgit2 project.
The 'git2' is the name specified via PROJECT() in CMakeLists.txt.
2012-05-14 20:22:50 +02:00
Vicent Martí
e49cb1687e Merge pull request #671 from nulltoken/topic/blob_create_fromdisk
Add git_blob_create_fromdisk()
2012-05-14 11:03:30 -07:00
Vicent Martí
72bfde9790 Merge pull request #681 from scottjg/solaris-fixes
Fix build/runtime issues on Solaris
2012-05-14 11:01:14 -07:00
Vicent Martí
27f5b7cfed Merge pull request #682 from arrbee/attribute-cache-buster
Attribute cache buster
2012-05-14 10:58:23 -07:00
Sascha Cunz
0c9a5565f7 Add missing GIT_EXTERN declarations 2012-05-14 19:56:35 +02:00
Vicent Martí
546ca93993 Merge pull request #689 from scunz/visibility-gcc
Use -fvisibility=hidden in GCC builds
2012-05-14 10:50:20 -07:00
Vicent Martí
0d6b776cb9 Merge pull request #694 from nulltoken/topic/mergebase-test-coverage
mergebase: enhance test code coverage
2012-05-14 10:49:42 -07:00
Russell Belfer
8f12d136c9 Merge pull request #695 from nulltoken/topic/iterator_free_null_tolerant
iterator: prevent git_iterator_free() from segfaulting when being passed a NULL iterator
2012-05-14 09:37:13 -07:00
Scott J. Goldman
212eb09d5f Add a test to verify FILENAME_MAX
Since we now rely on it (at least under Solaris), I figured we probably
want to make sure it's accurate. The new test makes sure that creating a
file with a name of length FILENAME_MAX+1 fails.
2012-05-13 23:12:51 -07:00
nulltoken
87fe3507bb iterator: prevent git_iterator_free() from segfaulting when being passed a NULL iterator 2012-05-13 19:09:57 +02:00
nulltoken
7327a090e2 mergebase: enhance test code coverage 2012-05-13 14:14:08 +02:00
Carlos Martín Nieto
f0b350eb52 tests: make sure we clean up in objects/blob/write.c 2012-05-13 11:28:49 +02:00
nulltoken
6ca9643c96 blob: Add git_blob_create_fromdisk()
This function will create blobs in the object database from files anywhere on the filesystem. This can be run against bare and non-bare repositories.
2012-05-13 11:28:49 +02:00
nulltoken
48ce97dd96 branch: cover with test that moving a non existing branch returns ENOTFOUND 2012-05-13 11:03:29 +02:00
nulltoken
341a7136f6 branch: make git_branch_delete() return GIT_ENOTFOUND when the branch doesn't exist 2012-05-13 10:30:13 +02:00
Han-Wen Nienhuys
24634c6fd0 Handle duplicate objects from different backends in git_odb_read_prefix(). 2012-05-12 15:50:19 -03:00
Scott J. Goldman
6fb1c0b489 Fix readdir_r() usage for Solaris
On Solaris, struct dirent is defined differently than Linux. The field
containing the path name is of size 0, rather than NAME_MAX. So, we need to
use a properly sized buffer on Solaris to avoid a stack overflow.

Also fix some DIR* leaks on cleanup.
2012-05-12 09:51:32 -07:00
Sascha Cunz
b15bef2301 Use -fvisibility=hidden in GCC builds 2012-05-12 11:12:42 +02:00
Vicent Martí
b72969e064 Merge pull request #683 from arrbee/better-repo-init
Improve repo initialization to be more like git
2012-05-12 01:51:58 -07:00
Vicent Martí
cd062ee27f Merge pull request #687 from nulltoken/fix/object-lookup-take-2
object: make git_object_lookup() return GIT_ENOTFOUND - The sequel
2012-05-12 01:42:21 -07:00
nulltoken
e28c37761b object: make git_object_lookup() return GIT_ENOTFOUND when searching for an existing object by specifying an incorrect type
This fix complements cb0ce16bbe and cover the following additional use cases

 - retrieving an object which has been previously searched, found and cached
 - retrieving an object through an non ambiguous abbreviated id
2012-05-11 23:56:23 +02:00
Carlos Martín Nieto
41178b419a examples: fix an oopsie 2012-05-11 21:49:33 +02:00
Ben Straub
7c22e72ba6 Removing test whose results are platform-dependent. 2012-05-11 12:21:58 -07:00
Russell Belfer
db62807215 Fixed leaks and added tests 2012-05-11 12:16:19 -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
92ad5a5cda Rebasing onto libgit2/development: cleanup. 2012-05-11 11:55:20 -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
d13c1a8b60 Fixing broken tests. 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
Ben Straub
27ee848397 Rev-parse: plugging (most) memory leaks. 2012-05-11 11:30:46 -07:00
Ben Straub
e88b8bd593 Incorporating feedback from @tanoku.
Removed repeated strlen's, and unnecessary loop-termination variable.
2012-05-11 11:30:46 -07:00
Ben Straub
5748fdee52 Rev-parse chaining: adding the longest chain
in the test repo.
2012-05-11 11:30:46 -07:00
Ben Straub
a51bdbcfa1 Implementing rev-parse's ref@{n} and @{-n} syntaxes.
Added some reflags to the test repo to support
unit tests.
2012-05-11 11:30:46 -07:00
Ben Straub
bfc13e7985 Adding comment documentation for rev-parse api. 2012-05-11 11:30:46 -07:00
Ben Straub
38533d5acf Implementing rev-parse's "ref~2" syntax.
Also extended the test suite to include chaining
operators, e.g. "master^2~3^4".
2012-05-11 11:30:46 -07:00
Ben Straub
e0887d8178 Removed goto from state machine loop. 2012-05-11 11:30:46 -07:00
Ben Straub
7149a6252c Returning error if dereferencing operation fails. 2012-05-11 11:30:46 -07:00
Ben Straub
387d01b857 Implemented rev-parse "^{type}" syntax. 2012-05-11 11:30:45 -07:00