Commit Graph

3908 Commits

Author SHA1 Message Date
Russell Belfer
eecc805029 Update callback fn ptr for git_reference_foreach
As part of API review, use a typedef for the callback fn ptr.
2012-11-27 13:18:28 -08:00
Russell Belfer
e120123e36 API review / update for tree.h 2012-11-27 13:18:28 -08:00
Russell Belfer
824cb2d5e5 Updates to reset.h 2012-11-27 13:18:28 -08:00
Ben Straub
3f63cc9e6d Examples: fix clone api 2012-11-27 13:18:28 -08:00
Ben Straub
bac695b58c Examples: fix reference names 2012-11-27 13:18:28 -08:00
Vicent Marti
cfbe4be3fb More external API cleanup
Conflicts:
	src/branch.c
	tests-clar/refs/branches/create.c
2012-11-27 13:18:27 -08:00
Ben Straub
2508cc66eb Rename ref and reflog apis for consistency 2012-11-27 13:17:45 -08:00
Vicent Martí
469827812f Merge pull request #1106 from frasertweedale/fix/freebsd-build
fix build on FreeBSD
2012-11-26 05:42:49 -08:00
Fraser Tweedale
9e9aee6705 fix build on FreeBSD
3f9eb1e introduced support for SSL certificates issued for IP
addresses, making use of in_addr and in_addr6 structs.  On FreeBSD
these are defined in (a file included in) <netinet/in.h>, so include
that file on FreeBSD and get the build working again.
2012-11-26 23:29:34 +10:00
Vicent Martí
8404f2d67f Merge pull request #1101 from csware/prevent_die
pack.c: Set p->mwf.fd to -1 on error
2012-11-26 03:56:25 -08:00
Vicent Martí
95cd83536f Merge pull request #1105 from delanne/invalid_read_config_file
Fix invalid read reported by valgrind
2012-11-26 03:53:53 -08:00
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