Commit Graph

22 Commits

Author SHA1 Message Date
schu
5e0de32818 Update Copyright header
Signed-off-by: schu <schu-github@schulog.org>
2012-02-13 17:11:09 +01:00
Russell Belfer
cfbc880d8a Patch cleanup for merge
After reviewing the gitignore support with Vicent, we came up
with a list of minor cleanups to prepare for merge, including:

* checking git_repository_config error returns
* renaming git_ignore_is_ignored and moving to status.h
* fixing next_line skipping to include \r skips
* commenting on where ignores are and are not included
2012-01-16 15:16:44 -08:00
Clemens Buchacher
599f2849ba add git_index_read_tree 2011-12-30 20:14:05 +01:00
Vicent Marti
87d9869fc3 Tabify everything
There were quite a few places were spaces were being used instead of
tabs. Try to catch them all. This should hopefully not break anything.
Except for `git blame`. Oh well.
2011-09-19 03:34:49 +03:00
Vicent Marti
bb742ede3d Cleanup legal data
1. The license header is technically not valid if it doesn't have a
copyright signature.

2. The COPYING file has been updated with the different licenses used in
the project.

3. The full GPLv2 header in each file annoys me.
2011-09-19 01:54:32 +03:00
David Boyce
d911172255 Standardized doxygen @return lines for int functions to say "GIT_SUCCESS or an error code". 2011-09-13 12:30:25 -04:00
Kirill A. Shutemov
7d9cc9f81a index: fix cast warnings
/home/kas/git/public/libgit2/src/index.c: In function ‘git_index_clear’:
/home/kas/git/public/libgit2/src/index.c:228:8: warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual]
/home/kas/git/public/libgit2/src/index.c:235:8: warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual]
/home/kas/git/public/libgit2/src/index.c: In function ‘index_insert’:
/home/kas/git/public/libgit2/src/index.c:392:7: warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual]
/home/kas/git/public/libgit2/src/index.c:399:7: warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual]
/home/kas/git/public/libgit2/src/index.c: In function ‘read_unmerged’:
/home/kas/git/public/libgit2/src/index.c:681:35: warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual]
/home/kas/git/public/libgit2/src/index.c: In function ‘read_entry’:
/home/kas/git/public/libgit2/src/index.c:716:33: warning: cast discards ‘__attribute__((const))’ qualifier from pointer target type [-Wcast-qual]

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
2011-07-25 21:12:47 +02:00
Kirill A. Shutemov
245adf4f3c index: introduce git_index_uniq() function
It removes all entries with equal path except last added.

On large indexes git_index_append() + git_index_uniq() before writing is
*much* faster, than git_index_add().

Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
2011-07-05 17:52:39 +03:00
Romain Geissler
f11e079733 Index: API uniformisation: Use unsigned int for all index number.
Feature Added: Search an unmerged entry by path (git_index_get_unmerged
renamed to git_index_get_unmerged_bypath) or by index (git_index_get_unmerged_byindex).
2011-06-05 21:19:03 +02:00
Vicent Marti
3a42e0a370 index: Add git_index_entry_stage method
As suggested by Romain-Geissler
2011-06-03 21:38:55 +02:00
Vicent Marti
f7e59c4dcf index: Change the memory management for repo indexes
The `git_repository_index` call now returns a brand new index that must
be manually free'd.
2011-06-01 18:54:47 +02:00
Vicent Marti
f4e2aca29c index: Fix issues in the unmerged entries API 2011-05-19 20:38:17 +03:00
Jakob Pfender
050e8877dd Merge branch 'development' into unmerged 2011-05-17 15:31:05 +02:00
Jason R. McNeil
773bc20dd3 Fix misspelling of git_index_append2 (was git_index_apppend2). 2011-05-03 22:22:42 -07:00
Vicent Marti
1648fbd344 Re-apply missing patches 2011-05-02 01:12:53 +03:00
Vicent Marti
f7a5058aaf index: Refactor add/replace methods
Removed the optional `replace` argument, we now have 4 add methods:

	`git_index_add`: add or update from path
	`git_index_add2`: add or update from struct
	`git_index_append`: add without replacing from path
	`git_index_append2`: add without replacing from struct

Yes, this breaks the bindings.
2011-04-24 00:31:43 +03:00
Jakob Pfender
4c0b6a6dac index: Add API for unmerged entries
New external functions:
	- git_index_unmerged_entrycount: Counts the unmerged entries in
	  the index
	- git_index_get_unmerged: Gets an unmerged entry from the index
	  by name

New internal functions:
	- read_unmerged: Wrapper for read_unmerged_internal
	- read_unmerged_internal: Reads unmerged entries from the index
	  if the index has the INDEX_EXT_UNMERGED_SIG set
	- unmerged_srch: Search function for unmerged vector
	- unmerged_cmp: Compare function for unmerged vector

New data structures:
	- git_index now contains a git_vector unmerged that stores
	  unmerged entries
	- git_index_entry_unmerged: Representation of an unmerged file
	  entry. It represents all three versions of the file at the
	  same time, with one name, three modes and three OIDs
2011-04-21 10:54:54 +02:00
Jakob Pfender
729b6f4900 index: Allow user to toggle whether to replace an index entry
When in the middle of a merge, the index needs to contain several files
with the same name. git_index_insert() used to prevent this by not adding a new entry if an entry with the same name already existed.
2011-04-21 10:40:54 +02:00
Jakob Pfender
26f2c897b8 index.h: Add IDXENTRY flags needed for index operations
Add several IDXENTRY flags that need to be checked in
order to properly implement update-index --refresh.
2011-04-08 03:33:50 +03:00
Jakob Pfender
051d6915d7 index.h: Fix minor typo 2011-03-25 00:49:47 +02:00
Jakob Pfender
12f6d8e145 index.h: Correct documentation for git_index_open_inrepo()
Fix the doxygen comments for git_index_open_inrepo(). Previously they
referred to a param index_path and omitted index (probably a c&p
error).
2011-03-25 00:49:47 +02:00
Vicent Marti
71d33382a7 Move the external includes folder from src to include
Signed-off-by: Vicent Marti <tanoku@gmail.com>
2011-03-03 20:23:53 +02:00