Commit Graph

3797 Commits

Author SHA1 Message Date
delanne
f2696fa412 Fix invalid read reported by valgrind 2012-11-26 12:12:41 +01:00
Sven Strickroth
fcb48e0680 Set p->mwf.fd to -1 on error
If p->mwf.fd is e.g. -2 then it is closed in packfile_free and an exception might be thrown.

Signed-off-by: Sven Strickroth <email@cs-ware.de>
2012-11-24 15:50:51 +01:00
Vicent Martí
c4d8df27bc Merge pull request #1097 from nulltoken/topic/head_tree_error
Make `git_repository_head_tree()` return error codes
2012-11-23 15:19:47 -08:00
Vicent Martí
28de452a4b Merge pull request #1093 from libgit2/contributing
Create contributing guidelines
2012-11-23 15:18:30 -08:00
Vicent Martí
c9f1658ead Merge pull request #1098 from scunz/cleanup_in_cleanup
Reset all static variables to NULL in clar's __cleanup
2012-11-23 15:17:48 -08:00
Edward Thomson
e226861e8d Merge pull request #1100 from martinwoodward/fuckityfuck
Remove use of English expletives
2012-11-23 11:33:32 -08:00
Martin Woodward
826bc4a81b Remove use of English expletives
Remove words such as fuck, crap, shit etc.
Remove other potentially offensive words from comments.
Tidy up other geopolicital terms in comments.
2012-11-23 13:31:22 +00:00
Sascha Cunz
9094d30b93 Reset all static variables to NULL in clar's __cleanup
Without this change, any failed assertion in the second (or a later) test
inside a test suite has a chance of double deleting memory, resulting in
a heap corruption. See #1096 for details.

This leaves alone the test cases where we "just" use cl_git_sandbox_init()
and cl_git_sandbox_cleanup(). These methods already take good care to not
double delete a repository.

Fixes #1096
2012-11-23 11:41:56 +01:00
nulltoken
5cec896a3b repo: Make git_repository_head_tree() return error codes 2012-11-22 18:51:06 +01:00
nulltoken
a94002a983 test: Minor fixes 2012-11-22 18:50:50 +01:00
Philip Kelley
5cf1b4f094 Call git_remote_update_tips before git_remote_disconnect 2012-11-22 11:16:35 -05:00
Philip Kelley
5d4cdb0494 Merge pull request #1095 from martinwoodward/authors
Update to Authors
2012-11-22 08:10:35 -08:00
Ben Straub
24aec6db55 Rewrite conventions to be more complete 2012-11-21 13:42:12 -07:00
Ben Straub
ee72ffd060 Markdownize CONVENTIONS 2012-11-20 21:11:41 -07:00
Ben Straub
41b00cccb1 Add contributing guidelines 2012-11-20 21:11:41 -07:00
Russell Belfer
54be4d57ed Merge pull request #1092 from arrbee/legal-to-not-have-gitconfig
It is okay to not have a .gitconfig file
2012-11-20 15:02:06 -08:00
Russell Belfer
38f7d026dc Need to clear ignored error from config load 2012-11-20 14:50:36 -08:00
Russell Belfer
f0ebf82e1a Merge pull request #1089 from edubart/fix_win32_lstat
Fix win32 lstat
2012-11-20 11:34:12 -08:00
Russell Belfer
cc6b4162de It is okay to not have a .gitconfig file
Opening a repo is generating an error if you don't have a
.gitconfig file in your home directory, but that should be
legal.
2012-11-20 10:24:18 -08:00
Eduardo Bart
cf0dadcf6e Minor optimization in win32 do_lstat 2012-11-20 01:19:31 -02:00
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