]> git.proxmox.com Git - libgit2.git/log
libgit2.git
12 years agoMerge pull request #726 from arrbee/utf16-home-dir
Russell Belfer [Thu, 24 May 2012 20:56:03 +0000 (13:56 -0700)]
Merge pull request #726 from arrbee/utf16-home-dir

Get user's home dir in UTF-16 clean manner

12 years agoFix bugs in UTF-8 <-> UTF-16 conversion
Russell Belfer [Thu, 24 May 2012 20:44:24 +0000 (13:44 -0700)]
Fix bugs in UTF-8 <-> UTF-16 conversion

The function to convert UTF-16 to UTF-8 was only allocating a
buffer of wcslen(utf16str) bytes for the UTF-8 string, but that
is not sufficient if you have multibyte characters, and so when
those occured, the conversion was failing.  This updates the
conversion functions to use the Win APIs to calculate the correct
buffer lengths.

Also fixes a comparison in the unit tests that would fail if
you did not have a particular environment variable set.

12 years agorepository: default to core.bare = false if it's not set
Carlos Martín Nieto [Thu, 24 May 2012 19:49:43 +0000 (21:49 +0200)]
repository: default to core.bare = false if it's not set

We used to consider a missing core.bare option to mean that the
repository was corrupt. This is too strict. Consider it a non-bare
repository if it's not set.

12 years agoGet user's home dir in UTF-16 clean manner
Russell Belfer [Thu, 24 May 2012 19:45:20 +0000 (12:45 -0700)]
Get user's home dir in UTF-16 clean manner

On Windows, we are having problems with home directories
that have non-ascii characters in them.  This rewrites the
relevant code to fetch environment variables as UTF-16 and
then explicitly map then into UTF-8 for our internal usage.

12 years agoexamples/network: consistently use tabs for indentation
Carlos Martín Nieto [Thu, 24 May 2012 14:41:53 +0000 (16:41 +0200)]
examples/network: consistently use tabs for indentation

12 years agoREADME: use docs/rel-notes/ for the release notes
Carlos Martín Nieto [Thu, 24 May 2012 11:38:25 +0000 (13:38 +0200)]
README: use docs/rel-notes/ for the release notes

12 years agoMerge pull request #720 from nulltoken/fix/libgit2sharp_issue_153
Vicent Martí [Wed, 23 May 2012 22:05:03 +0000 (15:05 -0700)]
Merge pull request #720 from nulltoken/fix/libgit2sharp_issue_153

Make git_futils_mkdir_r() able to cope with Windows network paths

12 years agoMerge pull request #712 from waywardmonkeys/embedded_makefile_fixes
Vicent Martí [Wed, 23 May 2012 22:03:07 +0000 (15:03 -0700)]
Merge pull request #712 from waywardmonkeys/embedded_makefile_fixes

Embedded makefile fixes

12 years agoMerge pull request #716 from scottjg/examples-cleanup
Vicent Martí [Wed, 23 May 2012 22:01:52 +0000 (15:01 -0700)]
Merge pull request #716 from scottjg/examples-cleanup

Build fixes for examples/

12 years agoMerge pull request #723 from carlosmn/rel-notes
Vicent Martí [Wed, 23 May 2012 17:10:04 +0000 (10:10 -0700)]
Merge pull request #723 from carlosmn/rel-notes

Add notice about release notes

12 years agoREADME: add rules about writing release notes as they happen
Carlos Martín Nieto [Wed, 23 May 2012 15:12:14 +0000 (17:12 +0200)]
README: add rules about writing release notes as they happen

12 years agoCONVENTIONS: Update error code names
Carlos Martín Nieto [Wed, 23 May 2012 14:42:02 +0000 (16:42 +0200)]
CONVENTIONS: Update error code names

12 years agoRemove left-over debugging output
Carlos Martín Nieto [Wed, 23 May 2012 10:59:21 +0000 (12:59 +0200)]
Remove left-over debugging output

12 years agofileops: Make git_futils_mkdir_r() able to cope with Windows network paths
nulltoken [Wed, 23 May 2012 10:05:48 +0000 (12:05 +0200)]
fileops: Make git_futils_mkdir_r() able to cope with Windows network paths

Partially fix libgit2/libgit2sharp#153

12 years agoAdd CMake build for examples / add them to Travis
Scott J. Goldman [Sun, 20 May 2012 07:46:48 +0000 (00:46 -0700)]
Add CMake build for examples / add them to Travis

By default, they are still not built, but hopefully, now that Travis is
building them, this will help stave off some of the bitrot.

12 years agoFix examples/general.c compilation
Scott J. Goldman [Sun, 20 May 2012 07:40:31 +0000 (00:40 -0700)]
Fix examples/general.c compilation

git_reference_listall() -> git reference_list()

12 years agoMerge pull request #715 from schu/cleanup-misc
Vicent Martí [Sat, 19 May 2012 17:48:15 +0000 (10:48 -0700)]
Merge pull request #715 from schu/cleanup-misc

Cleanup

12 years agoCleanup
Michael Schubert [Sat, 19 May 2012 11:20:55 +0000 (13:20 +0200)]
Cleanup

* indexer: remove leftover printf

* commit: remove unused macros COMMIT_BASIC_PARSE, COMMIT_FULL_PARSE
  and COMMIT_PRINT

12 years agoMerge pull request #713 from waywardmonkeys/spelling
Vicent Martí [Sat, 19 May 2012 14:10:22 +0000 (07:10 -0700)]
Merge pull request #713 from waywardmonkeys/spelling

Fix spelling errors.

12 years agoFix spelling errors.
Bruce Mitchener [Sat, 19 May 2012 13:24:55 +0000 (20:24 +0700)]
Fix spelling errors.

12 years agoAllow passing additional defines and cflags to Makefile.embed.
Bruce Mitchener [Sat, 19 May 2012 11:06:19 +0000 (18:06 +0700)]
Allow passing additional defines and cflags to Makefile.embed.

12 years agoBuild xdiff as well in Makefile.embed.
Bruce Mitchener [Sat, 19 May 2012 11:05:56 +0000 (18:05 +0700)]
Build xdiff as well in Makefile.embed.

12 years agolibgit2 v0.17.0 "Lord of Diffstruction"
Vicent Marti [Fri, 18 May 2012 23:40:46 +0000 (01:40 +0200)]
libgit2 v0.17.0 "Lord of Diffstruction"

Welcome to yet another libgit2 release, this one being the
biggest we've shipped so far. Highlights on this release
include diff, branches, notes and submodules support. The new
diff API is shiny and powerful. Check it out.

Apologies, one more time, to all the early adopters for the
breaking API changes. We've been iterating on the error
handling for the library until we reached its current state,
which we believe it's significantly more usable both for normal
users and for developers of bindings to other languages.
Also, we've renamed a few legacy calls to ensure that the whole
external API uses a consistent naming scheme.

As always, check the API docs for the full list of new API calls
and backwards-incompatible changes.

http://libgit2.github.com/libgit2/

Changelog of new features follows:

Attributes:
- Added function macros to check attribute values instead of having
to manually compare them
- Added support for choosing the attribute loading order (workdir files
vs index) and to skip the systems' default `.gitattributes`
- Fixed issues when fetching attribute data on bare repositories

Blob:
- Added support for creating blobs from any file on disk (not
restricted to the repository's working directory)
- Aded support for smudge filters when writing blobs to the ODB
- So far only CRLF normalization is available

Branches:
- Added a high-level branch API:
- git_branch_create
- git_branch_delete
- git_branch_list
- git_branch_move

Commit:
- Commit messages are now filtered to match Git rules (stripping
comments and adding proper whitespacing rules)

Config:
- Added support for setting and getting multivars
- Added `git_config_get_mapped` to map the value of a config
variable based on its defaults

Diff:
- Added full diff API:
- tree to tree
- index to tree
- workdir to index
- workdir to tree
- blob to blob

- Added helper functions to print the diffs as valid patchfiles

Error handling:
- New design for the error handling API, taking into consideration
the requirements of dynamic languages

Indexer:
- Added streaming packfile indexer

Merge:
- Added support for finding the merge base between two commits

Notes:
- Full git-notes support:
- git_note_read
- git_note_message/git_note_oid
- git_note_create
- git_note_remove
- git_note_free
- git_note_foreach

References:
- Added `git_reference_name_to_oid` helper to resolve
a reference to its final OID

- Added `git_reference_cmp` to compare two references with
a stable order

Remotes:
- Added support for writing and saving remotes
- `git_remote_add`
- `git_remote_save`
- Setters for all the attributes of a remote
- Switched remote download to the new streaming packfile indexer
- Fixed fetch on HTTP and Git under Windows
- Added `git_remote_supported_url` helper to check if a protocol
can be accessed by the library
- Added `git_remote_list`

Repository:
- Made `git_repository_open` smarter when finding the `.git` folder.
- Added `git_repository_open_ext` with extra options when
opening a repository

Revwalk:
- Added support for pushing/hiding several references through a glob
- Added helper to push/hide the current HEAD to the walker
- Added helper to push/hide a single reference to the walker

Status:
- Greatly improved Status implementation using the new `diff` code
as a backend

Submodules:
- Added a partial submodules API to get information about a
submodule and list all the submodules in a repository
- git_submodule_foreach
- git_submodule_lookup

Tag:
- Added `git_tag_peel` helper to peel a tag to its pointed object
- Tag messages are now filtered to match Git rules (stripping comments
and adding proper whitespacing rules)

Tree:
- Killed the old `git_tree_diff` API, which is replaced by the
new diff code.

Signed-off-by: Vicent Marti <tanoku@gmail.com>
12 years agoMerge pull request #710 from libgit2/breaking-changes
Vicent Martí [Fri, 18 May 2012 20:53:38 +0000 (13:53 -0700)]
Merge pull request #710 from libgit2/breaking-changes

Break everything before the release

12 years agoMerge pull request #711 from schu/fetch-local-dummy
Vicent Martí [Fri, 18 May 2012 11:38:15 +0000 (04:38 -0700)]
Merge pull request #711 from schu/fetch-local-dummy

fetch: set dummy function for local fetch

12 years agofetch: set dummy function for local fetch
Michael Schubert [Fri, 18 May 2012 10:36:25 +0000 (12:36 +0200)]
fetch: set dummy function for local fetch

Local fetch isn't implemented yet. Don't segfault on call, but set a
dummy for negotiate_fetch and terminate gracefully.

Reported-by: Brad Harder <bch@methodlogic.net>
12 years agoMerge pull request #685 from nulltoken/fix/list-remote-branches
Vicent Martí [Thu, 17 May 2012 23:51:17 +0000 (16:51 -0700)]
Merge pull request #685 from nulltoken/fix/list-remote-branches

branch: retrieve symbolic references when listing the branches

12 years agoerrors: Rename error codes
Vicent Martí [Thu, 17 May 2012 23:48:50 +0000 (01:48 +0200)]
errors: Rename error codes

12 years agoerrors: Rename the generic return codes
Vicent Martí [Thu, 17 May 2012 23:21:06 +0000 (01:21 +0200)]
errors: Rename the generic return codes

12 years agoProperly tag all `enums` with a `_t`
Vicent Martí [Thu, 17 May 2012 22:42:24 +0000 (00:42 +0200)]
Properly tag all `enums` with a `_t`

12 years agorefs: git_reference_listall -> git_reference_list
Vicent Martí [Thu, 17 May 2012 18:35:48 +0000 (20:35 +0200)]
refs: git_reference_listall -> git_reference_list

12 years agoerrors: Remove old comments
Vicent Martí [Fri, 11 May 2012 10:20:19 +0000 (12:20 +0200)]
errors: Remove old comments

12 years agoglobal: Fix unit tests after reordering
Vicent Martí [Thu, 10 May 2012 09:50:29 +0000 (11:50 +0200)]
global: Fix unit tests after reordering

12 years agoglobal: Change parameter ordering in API
Vicent Martí [Thu, 10 May 2012 08:38:10 +0000 (10:38 +0200)]
global: Change parameter ordering in API

Consistency is good.

12 years agobranch: retrieve symbolic references when listing the branches
nulltoken [Fri, 11 May 2012 20:22:14 +0000 (22:22 +0200)]
branch: retrieve symbolic references when listing the branches

12 years agoMerge pull request #709 from arrbee/profiling-with-scottg
Vicent Martí [Thu, 17 May 2012 21:46:44 +0000 (14:46 -0700)]
Merge pull request #709 from arrbee/profiling-with-scottg

Profiling with scottg

12 years agoNo point in keeping commented out fn
Russell Belfer [Thu, 17 May 2012 21:44:17 +0000 (14:44 -0700)]
No point in keeping commented out fn

12 years agoMerge pull request #708 from arrbee/fix-empty-workdir-iterator
Vicent Martí [Thu, 17 May 2012 21:25:42 +0000 (14:25 -0700)]
Merge pull request #708 from arrbee/fix-empty-workdir-iterator

Fix workdir iterators on empty directories

12 years agoFix workdir iterators on empty directories
Russell Belfer [Thu, 17 May 2012 21:21:10 +0000 (14:21 -0700)]
Fix workdir iterators on empty directories

Creating a workdir iterator on a directory with absolutely
no files was returning an error (GIT_ENOTFOUND) instead of
an iterator for nothing.  This fixes that and includes two
new tests that cover that case.

12 years agoOther optimization and warning fixes
Russell Belfer [Thu, 17 May 2012 20:14:17 +0000 (13:14 -0700)]
Other optimization and warning fixes

This fixes a warning left by the earlier optimization and
addresses one of the other hotspots identified by GProf.

12 years agoOptimize away git_text_gather_stats in diff
Russell Belfer [Thu, 17 May 2012 20:06:20 +0000 (13:06 -0700)]
Optimize away git_text_gather_stats in diff

GProf shows `git_text_gather_stats` as the most expensive call
in large diffs.  The function calculates a lot of information
that is not actually used and does not do so in a optimal
order.  This introduces a tuned `git_buf_is_binary` function
that executes the same algorithm in a fraction of the time.

12 years agoBasic setup for profiling
Russell Belfer [Thu, 17 May 2012 20:05:17 +0000 (13:05 -0700)]
Basic setup for profiling

This fixes the examples so they will build and adds a PROFILE
option to the CMakeFile that enabled gprof info on non-Windows

12 years agoMerge pull request #706 from arrbee/fix_592_again
Vicent Martí [Thu, 17 May 2012 00:18:17 +0000 (17:18 -0700)]
Merge pull request #706 from arrbee/fix_592_again

Fix status for files under ignored dirs

12 years agoFix status for files under ignored dirs
Russell Belfer [Thu, 17 May 2012 00:02:06 +0000 (17:02 -0700)]
Fix status for files under ignored dirs

There was a bug where tracked files inside directories that were
inside ignored directories where not being found by status.  To
make that a little clearer, if you have a .gitignore with:

    ignore/

And then have the following files:

    ignore/dir/tracked     <-- actually a tracked file
    ignore/dir/untracked   <-- should be ignored

Then we would show the tracked file as being removed (because
when we got the to contained item "dir/" inside the ignored
directory, we decided it was safe to skip -- bzzt, wrong!).

This update is much more careful about checking that we are
not skipping over any prefix of a tracked item, regardless of
whether it is ignored or not.

As documented in diff.c, this commit does create behavior that
still differs from core git with regards to the handling of
untracked files contained inside ignored directories.  With
libgit2, those files will just not show up in status or diff.
With core git, those files don't show up in status or diff
either *unless* they are explicitly ignored by a .gitignore
pattern in which case they show up as ignored files.

Needless to say, this is a local behavior difference only, so
it should not be important and (to me) the libgit2 behavior
seems more consistent.

12 years agoMerge pull request #705 from nulltoken/fix/note_list_callback_signature
Vicent Martí [Wed, 16 May 2012 20:43:16 +0000 (13:43 -0700)]
Merge pull request #705 from nulltoken/fix/note_list_callback_signature

notes: make git_note_foreach() callback signature easier to cope with from a binding perspective

12 years agonotes: make git_note_foreach() callback signature easier to cope with from a binding...
nulltoken [Wed, 16 May 2012 19:21:24 +0000 (21:21 +0200)]
notes: make git_note_foreach() callback signature easier to cope with from a binding perspective

12 years agotree: Naming conventions
Vicent Martí [Wed, 16 May 2012 17:23:47 +0000 (19:23 +0200)]
tree: Naming conventions

12 years agoclar: Fix warning
Vicent Martí [Wed, 16 May 2012 17:17:32 +0000 (19:17 +0200)]
clar: Fix warning

12 years agotree: Kill the `git_tree_diff` functions
Vicent Martí [Wed, 16 May 2012 17:16:35 +0000 (19:16 +0200)]
tree: Kill the `git_tree_diff` functions

These are deprecated and replaced with the diffing code in git2/diff.h

12 years agoMerge pull request #700 from cholin/revwalk_reset
Vicent Martí [Wed, 16 May 2012 17:22:49 +0000 (10:22 -0700)]
Merge pull request #700 from cholin/revwalk_reset

really reset walker with git_revwalk_reset

12 years agoMerge pull request #702 from arrbee/fix-status-file
Vicent Martí [Wed, 16 May 2012 16:57:45 +0000 (09:57 -0700)]
Merge pull request #702 from arrbee/fix-status-file

Update git_status_file and add ranged iterators

12 years agoMerge pull request #703 from carlosmn/consistency
Vicent Martí [Wed, 16 May 2012 11:40:32 +0000 (04:40 -0700)]
Merge pull request #703 from carlosmn/consistency

A few indexer consistency checks

12 years agoDocument git_buf_common_prefix
Russell Belfer [Tue, 15 May 2012 23:33:05 +0000 (16:33 -0700)]
Document git_buf_common_prefix

This function fills in a git_buf with the common prefix of
an array of strings, but let's make that a little more clear.

12 years agoindexer: add more consistency checks
Carlos Martín Nieto [Tue, 15 May 2012 13:08:54 +0000 (15:08 +0200)]
indexer: add more consistency checks

Error out in finalize if there is junk after the packfile hash or we
couldn't process all the objects.

12 years agoFix notes to use new fixed iterator signature
Russell Belfer [Tue, 15 May 2012 21:51:30 +0000 (14:51 -0700)]
Fix notes to use new fixed iterator signature

12 years agoRanged iterators and rewritten git_status_file
Russell Belfer [Tue, 15 May 2012 21:17:39 +0000 (14:17 -0700)]
Ranged iterators and rewritten git_status_file

The goal of this work is to rewrite git_status_file to use the
same underlying code as git_status_foreach.

This is done in 3 phases:

1. Extend iterators to allow ranged iteration with start and
   end prefixes for the range of file names to be covered.
2. Improve diff so that when there is a pathspec and there is
   a common non-wildcard prefix of the pathspec, it will use
   ranged iterators to minimize excess iteration.
3. Rewrite git_status_file to call git_status_foreach_ext
   with a pathspec that covers just the one file being checked.

Since ranged iterators underlie the status & diff implementation,
this is actually fairly efficient.  The workdir iterator does
end up loading the contents of all the directories down to the
single file, which should ideally be avoided, but it is pretty
good.

12 years agoIntroduce GITERR_INDEXER
Carlos Martín Nieto [Tue, 15 May 2012 19:42:01 +0000 (21:42 +0200)]
Introduce GITERR_INDEXER

12 years agoreally reset walker with git_revwalk_reset
Nico von Geyso [Tue, 15 May 2012 15:03:07 +0000 (17:03 +0200)]
really reset walker with git_revwalk_reset

From the description  of git_revwalk_reset in revwalk.h the function should
clear all pushed and hidden commits, and leave the walker in a blank state (just like at creation).
Apparently everything gets reseted appart of pushed commits (walk->one and walk->twos)

This fix should reset the walker properly.

12 years agoMerge pull request #699 from nulltoken/fix/compilation-warnings
Vicent Martí [Mon, 14 May 2012 20:28:13 +0000 (13:28 -0700)]
Merge pull request #699 from nulltoken/fix/compilation-warnings

Fix compilation warnings

12 years agoFix compilation warnings
nulltoken [Mon, 14 May 2012 20:24:58 +0000 (22:24 +0200)]
Fix compilation warnings

12 years agoMerge pull request #696 from nulltoken/topic/notes-list
Vicent Martí [Mon, 14 May 2012 20:17:19 +0000 (13:17 -0700)]
Merge pull request #696 from nulltoken/topic/notes-list

Add git_note_foreach()

12 years agoRevert "Specifiy dllimport to MSVC if we're not building libgit2.dll"
Vicent Martí [Mon, 14 May 2012 20:15:53 +0000 (22:15 +0200)]
Revert "Specifiy dllimport to MSVC if we're not building libgit2.dll"

This reverts commit 1093e2de22f6ca245b09d758a3510899a8362048.

12 years agonotes: add git_notes_foreach()
nulltoken [Tue, 8 May 2012 15:58:40 +0000 (17:58 +0200)]
notes: add git_notes_foreach()

12 years agoMerge pull request #693 from nulltoken/topic/enhance_branch_move_test_coverage
Vicent Martí [Mon, 14 May 2012 18:25:55 +0000 (11:25 -0700)]
Merge pull request #693 from nulltoken/topic/enhance_branch_move_test_coverage

branch: cover with test that moving a non existing branch returns ENOTFOUND

12 years agoMerge pull request #692 from nulltoken/fix/delete-branch_ENOTFOUND
Vicent Martí [Mon, 14 May 2012 18:25:40 +0000 (11:25 -0700)]
Merge pull request #692 from nulltoken/fix/delete-branch_ENOTFOUND

branch: make git_branch_delete() return GIT_ENOTFOUND when the branch doesn't exist

12 years agoMerge pull request #688 from hanwen/master
Vicent Martí [Mon, 14 May 2012 18:24:37 +0000 (11:24 -0700)]
Merge pull request #688 from hanwen/master

See issue https://github.com/libgit2/libgit2/issues/680

12 years agoSpecifiy dllimport to MSVC if we're not building libgit2.dll
Sascha Cunz [Fri, 11 May 2012 02:25:23 +0000 (04:25 +0200)]
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.

12 years agoMerge pull request #671 from nulltoken/topic/blob_create_fromdisk
Vicent Martí [Mon, 14 May 2012 18:03:30 +0000 (11:03 -0700)]
Merge pull request #671 from nulltoken/topic/blob_create_fromdisk

Add git_blob_create_fromdisk()

12 years agoMerge pull request #681 from scottjg/solaris-fixes
Vicent Martí [Mon, 14 May 2012 18:01:14 +0000 (11:01 -0700)]
Merge pull request #681 from scottjg/solaris-fixes

Fix build/runtime issues on Solaris

12 years agoMerge pull request #682 from arrbee/attribute-cache-buster
Vicent Martí [Mon, 14 May 2012 17:58:23 +0000 (10:58 -0700)]
Merge pull request #682 from arrbee/attribute-cache-buster

Attribute cache buster

12 years agoAdd missing GIT_EXTERN declarations
Sascha Cunz [Fri, 11 May 2012 02:12:18 +0000 (04:12 +0200)]
Add missing GIT_EXTERN declarations

12 years agoMerge pull request #689 from scunz/visibility-gcc
Vicent Martí [Mon, 14 May 2012 17:50:20 +0000 (10:50 -0700)]
Merge pull request #689 from scunz/visibility-gcc

Use -fvisibility=hidden in GCC builds

12 years agoMerge pull request #694 from nulltoken/topic/mergebase-test-coverage
Vicent Martí [Mon, 14 May 2012 17:49:42 +0000 (10:49 -0700)]
Merge pull request #694 from nulltoken/topic/mergebase-test-coverage

mergebase: enhance test code coverage

12 years agoMerge pull request #695 from nulltoken/topic/iterator_free_null_tolerant
Russell Belfer [Mon, 14 May 2012 16:37:13 +0000 (09:37 -0700)]
Merge pull request #695 from nulltoken/topic/iterator_free_null_tolerant

iterator: prevent git_iterator_free() from segfaulting when being passed a NULL iterator

12 years agoAdd a test to verify FILENAME_MAX
Scott J. Goldman [Mon, 14 May 2012 06:12:51 +0000 (23:12 -0700)]
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.

12 years agoiterator: prevent git_iterator_free() from segfaulting when being passed a NULL iterator
nulltoken [Sun, 13 May 2012 17:09:25 +0000 (19:09 +0200)]
iterator: prevent git_iterator_free() from segfaulting when being passed a NULL iterator

12 years agomergebase: enhance test code coverage
nulltoken [Sun, 13 May 2012 10:21:00 +0000 (12:21 +0200)]
mergebase: enhance test code coverage

12 years agotests: make sure we clean up in objects/blob/write.c
Carlos Martín Nieto [Mon, 7 May 2012 09:48:39 +0000 (11:48 +0200)]
tests: make sure we clean up in objects/blob/write.c

12 years agoblob: Add git_blob_create_fromdisk()
nulltoken [Sun, 6 May 2012 19:00:20 +0000 (21:00 +0200)]
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.

12 years agobranch: cover with test that moving a non existing branch returns ENOTFOUND
nulltoken [Sun, 13 May 2012 09:03:29 +0000 (11:03 +0200)]
branch: cover with test that moving a non existing branch returns ENOTFOUND

12 years agobranch: make git_branch_delete() return GIT_ENOTFOUND when the branch doesn't exist
nulltoken [Sun, 13 May 2012 08:17:52 +0000 (10:17 +0200)]
branch: make git_branch_delete() return GIT_ENOTFOUND when the branch doesn't exist

12 years agoHandle duplicate objects from different backends in git_odb_read_prefix().
Han-Wen Nienhuys [Sat, 12 May 2012 18:01:39 +0000 (15:01 -0300)]
Handle duplicate objects from different backends in git_odb_read_prefix().

12 years agoFix readdir_r() usage for Solaris
Scott J. Goldman [Thu, 10 May 2012 06:45:55 +0000 (23:45 -0700)]
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.

12 years agoUse -fvisibility=hidden in GCC builds
Sascha Cunz [Sat, 12 May 2012 09:12:42 +0000 (11:12 +0200)]
Use -fvisibility=hidden in GCC builds

12 years agoMerge pull request #683 from arrbee/better-repo-init
Vicent Martí [Sat, 12 May 2012 08:51:58 +0000 (01:51 -0700)]
Merge pull request #683 from arrbee/better-repo-init

Improve repo initialization to be more like git

12 years agoMerge pull request #687 from nulltoken/fix/object-lookup-take-2
Vicent Martí [Sat, 12 May 2012 08:42:21 +0000 (01:42 -0700)]
Merge pull request #687 from nulltoken/fix/object-lookup-take-2

object: make git_object_lookup() return GIT_ENOTFOUND - The sequel

12 years agoobject: make git_object_lookup() return GIT_ENOTFOUND when searching for an existing...
nulltoken [Fri, 11 May 2012 21:56:23 +0000 (23:56 +0200)]
object: make git_object_lookup() return GIT_ENOTFOUND when searching for an existing object by specifying an incorrect type

This fix complements cb0ce16bbe8efe2098ef9cfffcf158301b036565 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

12 years agoexamples: fix an oopsie
Carlos Martín Nieto [Fri, 11 May 2012 19:49:33 +0000 (21:49 +0200)]
examples: fix an oopsie

12 years agoFixed leaks and added tests
Russell Belfer [Fri, 11 May 2012 19:16:19 +0000 (12:16 -0700)]
Fixed leaks and added tests

12 years agoFix comment typo in common.h
Scott J. Goldman [Fri, 11 May 2012 00:16:24 +0000 (17:16 -0700)]
Fix comment typo in common.h

12 years agoFix rmdir() usage on Solaris
Scott J. Goldman [Thu, 10 May 2012 07:37:03 +0000 (00:37 -0700)]
Fix rmdir() usage on Solaris

On Solaris, rmdir() throws EEXIST if the folder is not empty, so just add
one more case to check for that, alongside ENOTEMPTY.

12 years agoFixed mode on clar
Russell Belfer [Thu, 10 May 2012 18:15:37 +0000 (11:15 -0700)]
Fixed mode on clar

12 years agoAdd cache busting to attribute cache
Russell Belfer [Thu, 10 May 2012 18:08:59 +0000 (11:08 -0700)]
Add cache busting to attribute cache

This makes the git attributes and git ignores cache check
stat information before using the file contents from the
cache.  For cached files from the index, it checks the SHA
of the file instead.  This should reduce the need to ever
call `git_attr_cache_flush()` in most situations.

This commit also fixes the `git_status_should_ignore` API
to use the libgit2 standard parameter ordering.

12 years agoHook up Windows compat fnmatch() for Solaris
Scott J. Goldman [Thu, 10 May 2012 05:30:57 +0000 (22:30 -0700)]
Hook up Windows compat fnmatch() for Solaris

Since Solaris does not support some of the same flags as glibc fnmatch(),
we just use the implementation we have for Windows.

Now that it's no longer a windows-specific thing, I moved it into compat/
instead of win32/

12 years agoexamples: update network examples error handling
Carlos Martín Nieto [Thu, 10 May 2012 14:52:12 +0000 (16:52 +0200)]
examples: update network examples error handling

Use giterr_last() and make sure it's not NULL.

12 years agoclar: Update from upstream
Vicent Martí [Wed, 9 May 2012 20:54:24 +0000 (22:54 +0200)]
clar: Update from upstream

12 years agoMerge pull request #678 from nulltoken/fix/msvc-weird-error
Vicent Martí [Wed, 9 May 2012 19:34:13 +0000 (12:34 -0700)]
Merge pull request #678 from nulltoken/fix/msvc-weird-error

Fix MSVC compilation issue

12 years agoFix MSVC compilation issue
nulltoken [Wed, 9 May 2012 19:14:49 +0000 (21:14 +0200)]
Fix MSVC compilation issue

    exp() is already defined in math.h. This leads to LMSVC complaining

    ..\..\libgit2\tests-clar\diff\blob.c(5): error C2365: 'exp' : redefinition; previous definition was 'function'

    Renaming the variable fixes this issue.

12 years agoImprove repo initialization to be more like git
Russell Belfer [Tue, 8 May 2012 20:50:40 +0000 (13:50 -0700)]
Improve repo initialization to be more like git

This adds a bunch of template files to the initialization for
hooks, info/exclude, and description.  This makes our initialized
repo look more like core gits.

12 years agoFix 64-bit build warning
Russell Belfer [Wed, 9 May 2012 17:30:34 +0000 (10:30 -0700)]
Fix 64-bit build warning