Commit Graph

3727 Commits

Author SHA1 Message Date
Eduardo Bart
e566b609df Update clar tests p_lstat_posixly and p_lstat 2012-11-20 00:57:56 -02:00
Eduardo Bart
2d96fce20b update win32 lstat comment 2012-11-19 23:12:20 -02:00
Russell Belfer
d46b0a04c7 Improve iterator ignoring .git file
The workdir iterator has always tried to ignore .git files, but
it turns out there were some bugs.  This makes it more robust at
ignoring .git files.

This also makes iterators always check ".git" case insensitively
regardless of the properties of the system.  This will make libgit2
skip ".GIT" and the like.  This is different from core git, but on
systems with case insensitive but case preserving file systems,
allowing ".GIT" to be added is problematic.
2012-11-19 16:34:44 -08:00
Russell Belfer
02df42ddbf Set up default internal ignores
This adds "." ".." and ".git" to the internal ignores list by
default - asking about paths with these files will always say
that they are ignored.
2012-11-19 16:33:30 -08:00
Eduardo Bart
52ead7877d Fix win32 lstat 2012-11-19 22:30:20 -02:00
Russell Belfer
cfeef7ce2c Minor optimization to tree entry validity check
This checks for a leading '.' before looking for the invalid
tree entry names.  Even on pretty high levels of optimization,
this seems to make a measurable improvement.

I accidentally used && in the check initially instead of || and
while debugging ended up improving the error reporting of issues
with adding tree entries.  I thought I'd leave those changes, too.
2012-11-19 13:40:08 -08:00
Russell Belfer
a9069f6154 Merge pull request #1086 from scunz/vs_warning_level
VS-Build: Append C_FLAGS to the end of the already given ones.
2012-11-19 12:11:01 -08:00
Sascha Cunz
4a03913cfb VS-Build: Disable /W4 parameter, as it is not picked up anyway
My other PR revealed, that the /W4 parameter, we give to MSVC is ignored
because cmake set CMAKE_C_FLAGS already to /W3 and we overwrite it.

The command line tools gave me a D9025 warning for this on every file and
looking into the project properties page on MSVC 2008 tells, that it has
the warning level set to /W3.

However, the warnings introduced by /W4 are far to useless for having
them enabled. So just disable them.
2012-11-19 21:07:13 +01:00
Russell Belfer
7a1282f6f8 Merge pull request #1085 from scunz/no_pch_for_nmake
Don't use precompiled headers for command-line based VC builds.
2012-11-19 11:53:04 -08:00
Sascha Cunz
26d9e317db Don't use precompiled headers for command-line based VC builds.
The reason, why libgit2 currently cannot support compiling via the command-line
tools cl/nmake from WinSDK and/or Microsoft Visual Studio, seems to be a
missing dependency on the generated precompiled header file.

The Visual Studio IDE automatically inserts this dependency when it sees the
right combination of "/Y" parameters.

This patch allows to compile using command line tools by disabling precompiled
headers for NON-IDE builds.
2012-11-19 05:00:02 +01:00
Vicent Martí
560cc1e1ed Merge pull request #1084 from libgit2/filename-validation
Filename validation
2012-11-18 17:19:20 -08:00
Scott J. Goldman
1876360f81 Add a test for invalid filenames while writing tree from index 2012-11-18 16:59:42 -08:00
Scott J. Goldman
0d778b1a89 Catch invalid filenames in append_entry()
This prevents the index api from calling write_tree() with a
bogus tree.
2012-11-18 16:52:04 -08:00
Scott J. Goldman
19af78bb36 Prevent creating .., ., and .git with tree builder
As per core git.
2012-11-18 15:15:24 -08:00
Vicent Martí
629c082930 Merge pull request #1082 from scunz/fixDoubleDeleteOnError
Indexer: Avoid a possible double-deletion in error case
2012-11-18 14:15:04 -08:00
Sascha Cunz
4cc7342e95 Indexer: Avoid a possible double-deletion in error case 2012-11-18 09:07:35 +01:00
Michael Schubert
0066955d97 Fix a couple of warnings 2012-11-18 04:27:49 +01:00
nulltoken
0e9ea5d0e3 Merge pull request #1077 from nulltoken/fix/api
Itsy bitsy tiny winy minor api related fixes
2012-11-17 18:42:40 -08:00
nulltoken
b15df1d937 reflog: make entry_byindex() and drop() git compliant
Passing 0 as the index now retrieves the most recent entry instead
of the oldest one.
2012-11-17 18:30:35 -08:00
nulltoken
1a764476d2 reflog: Fix documentation 2012-11-17 18:30:34 -08:00
nulltoken
270160b91a config: Opening a nonexistent file returns ENOTFOUND 2012-11-17 18:30:34 -08:00
nulltoken
d36451c9d4 config: Make git_config_file__ondisk() internal 2012-11-17 12:34:15 -08:00
nulltoken
6091457e76 repo: ensure is_empty() checks there are no refs 2012-11-17 07:20:08 -08:00
nulltoken
f5a0e734bc tests: introduce cl_git_remove_placeholders() 2012-11-17 07:20:07 -08:00
nulltoken
5df7207a67 repo: readonly tests don't need a sandboxed repo 2012-11-17 07:20:04 -08:00
nulltoken
0e95e70a55 env: ensure git_futils_find_xxx() returns ENOTFOUND 2012-11-17 05:41:22 -08:00
nulltoken
aa8a76eff9 tag: rename git_tag_type to git_tag_target_type 2012-11-17 05:41:20 -08:00
nulltoken
86b9dbc12f Fix MSVC compilation warnings 2012-11-17 05:13:13 -08:00
Vicent Martí
e087973ec7 Merge pull request #1075 from carlosmn/alternates-recurse
odb: recursively load alternates
2012-11-16 10:27:46 -08:00
Carlos Martín Nieto
85e7efa163 odb: recursively load alternates
The maximum depth is 5, like in git
2012-11-16 08:46:02 -08:00
Scott J. Goldman
0cd063fd87 Merge pull request #1071 from arrbee/alternate-fix-strcmp
Win32 fixes for diff/checkout/reset
2012-11-15 23:28:52 -08:00
Michael Schubert
96acc0b615 AUTHORS: cleanup 2012-11-16 02:37:26 +01:00
Michael Schubert
0ec118280c Fix -Wmaybe-uninitialized warning 2012-11-16 02:17:57 +01:00
Ben Straub
414bd93667 Include Microsoft in AUTHORS 2012-11-15 16:20:02 -08:00
Vicent Martí
4a0c7f56ab Merge pull request #1074 from edubart/ignore_diff_filemode
Add option to ignore file mode in diffs
2012-11-15 10:31:11 -08:00
Vicent Martí
63f7c6f4c8 Merge pull request #1072 from arrbee/diff-api-signatures
Diff API signatures
2012-11-15 10:18:25 -08:00
Eduardo Bart
c0d5acf69a Add option to ignore file mode in diffs 2012-11-15 14:59:39 -02:00
Russell Belfer
bbe6dbec81 Add explicit git_index ptr to diff and checkout
A number of diff APIs and the `git_checkout_index` API take a
`git_repository` object an operate on the index.  This updates
them to take a `git_index` pointer explicitly and only fall back
on the `git_repository` index if the index input is NULL.  This
makes it easier to operate on a temporary index.
2012-11-14 23:29:48 -08:00
Russell Belfer
bad68c0a99 Add iterator for git_index object
The index iterator could previously only be created from a repo
object, but this allows creating an iterator from a `git_index`
object instead (while keeping, though renaming, the old function).
2012-11-14 22:55:40 -08:00
Russell Belfer
5735bf5e6a Fix diff API to better parameter order
The diff API is not in the parameter order one would expect from
other libgit2 APIs.  This fixes that.
2012-11-14 22:54:31 -08:00
Russell Belfer
402b92cfe9 Fix reset hard tests on platforms with CRLF
The reset hard tests had hardcoded expected file content and was
not correctly compensating for CRLF filtering when a file needed
to be reverted by the reset hard.  This fixes that.
2012-11-14 22:44:17 -08:00
Russell Belfer
cccacac555 Add POSIX compat lstat() variant for win32
The existing p_lstat implementation on win32 is not quite POSIX
compliant when setting errno to ENOTDIR.  This adds an option to
make is be compliant so that code (such as checkout) that cares
to have separate behavior for ENOTDIR can use it portably.

This also contains a couple of other minor cleanups in the
posix_w32.c implementations to avoid unnecessary work.
2012-11-14 22:41:51 -08:00
Russell Belfer
a277345e05 Create internal strcmp variants for function ptrs
Using the builtin strcmp and strcasecmp as function pointers is
problematic on win32.  This adds internal implementations and
divorces us from the platform linkage.
2012-11-14 22:37:13 -08:00
Vicent Martí
5a36f12780 Merge pull request #1069 from carlosmn/readme
Explain a few CMake options in the README
2012-11-13 21:14:52 -08:00
Carlos Martín Nieto
66bf4dbc68 Explain a few CMake options in the README
Expose STDCALL and explain a few useful CMake options, as well as
explain the quirks building on Windows.
2012-11-13 20:57:19 -08:00
Carlos Martín Nieto
7e9f5e6500 Slightly different valgrind fix
Allocate with calloc rather than conditionally memsetting a specific
part of the struct later on.
2012-11-13 20:06:15 -08:00
Carlos Martín Nieto
6132a54e0b Fix a few valgrind errors 2012-11-13 16:17:37 -08:00
Vicent Martí
513e794ef4 Merge pull request #1068 from carlosmn/config-empty-value
Deal with empty and nonexsitent values in config
2012-11-13 14:59:18 -08:00
Carlos Martín Nieto
0da81d2b39 config: return an emtpy string when there is no value
Returning NULL for the string when we haven't signaled an error
condition is counter-intuitive and causes unnecessary edge
cases. Return an empty string when asking for a string value for a
configuration variable such as '[section] var' to avoid these edge
cases.

If the distinction between no value and an empty value is needed, this
can be retrieved from the entry directly. As a side-effect, this
change stops the int parsing functions from segfaulting on such a
variable.
2012-11-13 14:49:16 -08:00
Vicent Marti
f6c18dda04 http: Unrustle 2012-11-13 14:17:41 -08:00