summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt4
-rw-r--r--COPYING10
-rw-r--r--README.md2
-rw-r--r--examples/general.c24
-rw-r--r--include/git2/odb.h8
-rw-r--r--include/git2/oid.h2
-rw-r--r--include/git2/refs.h8
-rw-r--r--include/git2/repository.h8
-rw-r--r--include/git2/tag.h2
-rw-r--r--include/git2/tree.h2
-rw-r--r--include/git2/types.h2
-rw-r--r--src/filebuf.c2
-rw-r--r--src/fileops.c4
-rw-r--r--src/fileops.h20
-rw-r--r--src/hashtable.c10
-rw-r--r--src/hashtable.h2
-rw-r--r--src/index.c2
-rw-r--r--src/odb.c2
-rw-r--r--src/odb_pack.c12
-rw-r--r--src/oid.c2
-rw-r--r--src/pqueue.c2
-rw-r--r--src/pqueue.h2
-rw-r--r--src/refs.c28
-rw-r--r--src/repository.c10
-rw-r--r--src/signature.c10
-rw-r--r--src/tag.c28
-rw-r--r--src/tree.c20
-rw-r--r--src/util.c16
-rw-r--r--src/util.h8
-rw-r--r--src/vector.c2
-rw-r--r--tests/t00-core.c2
-rw-r--r--tests/t02-objread.c2
-rw-r--r--tests/t04-commit.c2
-rw-r--r--tests/t05-revwalk.c4
-rw-r--r--tests/t06-index.c2
-rw-r--r--tests/t10-refs.c10
-rwxr-xr-xtests/test_lib.h2
37 files changed, 139 insertions, 139 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d2d4f0fb6..30df62d79 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,7 +4,7 @@
# > mkdir build && cd build
# > cmake .. [-DSETTINGS=VALUE]
# > cmake --build .
-#
+#
# Testing:
# > ctest -V
#
@@ -90,7 +90,7 @@ SET_TARGET_PROPERTIES(git2 PROPERTIES VERSION ${LIBGIT2_VERSION_STRING})
SET_TARGET_PROPERTIES(git2 PROPERTIES SOVERSION ${LIBGIT2_VERSION_MAJOR})
# Install
-INSTALL(TARGETS git2
+INSTALL(TARGETS git2
RUNTIME DESTINATION ${INSTALL_BIN}
LIBRARY DESTINATION ${INSTALL_LIB}
ARCHIVE DESTINATION ${INSTALL_LIB}
diff --git a/COPYING b/COPYING
index c36f4cf1e..75bc6a1fe 100644
--- a/COPYING
+++ b/COPYING
@@ -71,7 +71,7 @@ patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
-
+
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
@@ -126,7 +126,7 @@ above, provided that you also meet all of these conditions:
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
-
+
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
@@ -184,7 +184,7 @@ access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
-
+
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
@@ -241,7 +241,7 @@ impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
-
+
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
@@ -294,7 +294,7 @@ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
-
+
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
diff --git a/README.md b/README.md
index 825cf3e30..2c24da45e 100644
--- a/README.md
+++ b/README.md
@@ -101,7 +101,7 @@ GitHub, or join us on the mailing list by sending an email to:
libgit2@librelist.com
-License
+License
==================================
libgit2 is under GPL2 **with linking exemption**. This means you
can link to the library with any program, commercial, open source or
diff --git a/examples/general.c b/examples/general.c
index dbecbd206..f02c40977 100644
--- a/examples/general.c
+++ b/examples/general.c
@@ -1,7 +1,7 @@
// [**libgit2**][lg] is a portable, pure C implementation of the Git core methods
// provided as a re-entrant linkable library with a solid API, allowing you
-// to write native speed custom Git applications in any language which
-// supports C bindings.
+// to write native speed custom Git applications in any language which
+// supports C bindings.
//
// This file is an example of using that API in a real, compilable C file.
// As the API is updated, this file will be updated to demonstrate the
@@ -65,8 +65,8 @@ int main (int argc, char** argv)
// ### Working with the Object Database
// **libgit2** provides [direct access][odb] to the object database.
- // The object database is where the actual objects are stored in Git. For
- // working with raw objects, we'll need to get this structure from the
+ // The object database is where the actual objects are stored in Git. For
+ // working with raw objects, we'll need to get this structure from the
// repository.
// [odb]: http://libgit2.github.com/libgit2/#HEAD/group/odb
git_odb *odb;
@@ -94,10 +94,10 @@ int main (int argc, char** argv)
data = (const unsigned char *)git_odb_object_data(obj);
otype = git_odb_object_type(obj);
- // We provide methods to convert from the object type which is an enum, to a string
+ // We provide methods to convert from the object type which is an enum, to a string
// representation of that value (and vice-versa).
str_type = git_object_type2string(otype);
- printf("object length and type: %d, %s\n",
+ printf("object length and type: %d, %s\n",
(int)git_odb_object_size(obj),
str_type);
@@ -126,7 +126,7 @@ int main (int argc, char** argv)
// yourself.
// #### Commit Parsing
- // [Parsing commit objects][pco] is simple and gives you access to all the data in the commit
+ // [Parsing commit objects][pco] is simple and gives you access to all the data in the commit
// - the // author (name, email, datetime), committer (same), tree, message, encoding and parent(s).
// [pco]: http://libgit2.github.com/libgit2/#HEAD/group/commit
@@ -156,7 +156,7 @@ int main (int argc, char** argv)
printf("Author: %s (%s)\n", author->name, author->email);
// Commits can have zero or more parents. The first (root) commit will have no parents, most commits
- // will have one, which is the commit it was based on, and merge commits will have two or more.
+ // will have one, which is the commit it was based on, and merge commits will have two or more.
// Commits can technically have any number, though it's pretty rare to have more than two.
parents = git_commit_parentcount(commit);
for (p = 0;p < parents;p++) {
@@ -191,7 +191,7 @@ int main (int argc, char** argv)
987654321, 90);
// Commit objects need a tree to point to and optionally one or more parents. Here we're creating oid
- // objects to create the commit with, but you can also use
+ // objects to create the commit with, but you can also use
git_oid_fromstr(&tree_id, "28873d96b4e8f4e33ea30f4c682fd325f7ba56ac");
git_oid_fromstr(&parent_id, "f0877d0b841d75172ec404fc9370173dfffc20d1");
@@ -227,7 +227,7 @@ int main (int argc, char** argv)
error = git_tag_lookup(&tag, repo, &oid);
// Now that we have the tag object, we can extract the information it generally contains: the target
- // (usually a commit object), the type of the target object (usually 'commit'), the name ('v1.0'),
+ // (usually a commit object), the type of the target object (usually 'commit'), the name ('v1.0'),
// the tagger (a git_signature - name, email, timestamp), and the tag message.
git_tag_target((git_object **)&commit, tag);
tname = git_tag_name(tag); // "test"
@@ -275,7 +275,7 @@ int main (int argc, char** argv)
//
// The last object type is the simplest and requires the least parsing help. Blobs are just file
// contents and can contain anything, there is no structure to it. The main advantage to using the
- // [simple blob api][ba] is that when you're creating blobs you don't have to calculate the size
+ // [simple blob api][ba] is that when you're creating blobs you don't have to calculate the size
// of the content. There is also a helper for reading a file from disk and writing it to the db and
// getting the oid back so you don't have to do all those steps yourself.
//
@@ -343,7 +343,7 @@ int main (int argc, char** argv)
// ### Index File Manipulation
//
- // The [index file API][gi] allows you to read, traverse, update and write the Git index file
+ // The [index file API][gi] allows you to read, traverse, update and write the Git index file
// (sometimes thought of as the staging area).
//
// [gi]: http://libgit2.github.com/libgit2/#HEAD/group/index
diff --git a/include/git2/odb.h b/include/git2/odb.h
index 06b9aa5f1..ef16e1e42 100644
--- a/include/git2/odb.h
+++ b/include/git2/odb.h
@@ -91,7 +91,7 @@ GIT_EXTERN(int) git_odb_add_backend(git_odb *odb, git_odb_backend *backend, int
* backend will work as an alternate.
*
* Alternate backends are always checked for objects *after*
- * all the main backends have been exhausted.
+ * all the main backends have been exhausted.
*
* The backends are checked in relative ordering, based on the
* value of the `priority` parameter.
@@ -220,12 +220,12 @@ GIT_EXTERN(int) git_odb_write(git_oid *oid, git_odb *odb, const void *data, size
*
* The returned stream will be of type `GIT_STREAM_WRONLY` and
* will have the following methods:
- *
+ *
* - stream->write: write `n` bytes into the stream
* - stream->finalize_write: close the stream and store the object in
* the odb
* - stream->free: free the stream
- *
+ *
* The streaming write won't be effective until `stream->finalize_write`
* is called and returns without an error
*
@@ -252,7 +252,7 @@ GIT_EXTERN(int) git_odb_open_wstream(git_odb_stream **stream, git_odb *db, size_
*
* The returned stream will be of type `GIT_STREAM_RDONLY` and
* will have the following methods:
- *
+ *
* - stream->read: read `n` bytes from the stream
* - stream->free: free the stream
*
diff --git a/include/git2/oid.h b/include/git2/oid.h
index 46d0dce0d..96f8649f0 100644
--- a/include/git2/oid.h
+++ b/include/git2/oid.h
@@ -215,7 +215,7 @@ int git_oid_shorten_add(git_oid_shorten *os, const char *text_oid);
/**
* Free an OID shortener instance
- *
+ *
* @param os a `git_oid_shorten` instance
*/
void git_oid_shorten_free(git_oid_shorten *os);
diff --git a/include/git2/refs.h b/include/git2/refs.h
index 9cefca780..ff2bc9d87 100644
--- a/include/git2/refs.h
+++ b/include/git2/refs.h
@@ -95,7 +95,7 @@ GIT_EXTERN(int) git_reference_create_oid(git_reference **ref_out, git_repository
/**
* Get the OID pointed to by a reference.
- *
+ *
* Only available if the reference is direct (i.e. not symbolic)
*
* @param ref The reference
@@ -105,7 +105,7 @@ GIT_EXTERN(const git_oid *) git_reference_oid(git_reference *ref);
/**
* Get full name to the reference pointed by this reference
- *
+ *
* Only available if the reference is symbolic
*
* @param ref The reference
@@ -132,7 +132,7 @@ GIT_EXTERN(git_rtype) git_reference_type(git_reference *ref);
GIT_EXTERN(const char *) git_reference_name(git_reference *ref);
/**
- * Resolve a symbolic reference
+ * Resolve a symbolic reference
*
* Thie method iteratively peels a symbolic reference
* until it resolves to a direct reference to an OID.
@@ -212,7 +212,7 @@ GIT_EXTERN(int) git_reference_delete(git_reference *ref);
* Pack all the loose references in the repository
*
* This method will load into the cache all the loose
- * references on the repository and update the
+ * references on the repository and update the
* `packed-refs` file with them.
*
* Once the `packed-refs` file has been written properly,
diff --git a/include/git2/repository.h b/include/git2/repository.h
index 3b2b9dc04..4088ff7f9 100644
--- a/include/git2/repository.h
+++ b/include/git2/repository.h
@@ -71,7 +71,7 @@ GIT_EXTERN(int) git_repository_open(git_repository **repository, const char *pat
*
* @param git_dir The full path to the repository folder
* e.g. a '.git' folder for live repos, any folder for bare
- * Equivalent to $GIT_DIR.
+ * Equivalent to $GIT_DIR.
* Cannot be NULL.
*
* @param git_object_directory The full path to the ODB folder.
@@ -105,7 +105,7 @@ GIT_EXTERN(int) git_repository_open2(git_repository **repository,
*
* @param git_dir The full path to the repository folder
* e.g. a '.git' folder for live repos, any folder for bare
- * Equivalent to $GIT_DIR.
+ * Equivalent to $GIT_DIR.
* Cannot be NULL.
*
* @param object_database A pointer to a git_odb created & initialized
@@ -210,8 +210,8 @@ GIT_EXTERN(void) git_repository_free(git_repository *repo);
*
* @param repo_out pointer to the repo which will be created or reinitialized
* @param path the path to the repository
- * @param is_bare if true, a Git repository without a working directory is created
- * at the pointed path. If false, provided path will be considered as the working
+ * @param is_bare if true, a Git repository without a working directory is created
+ * at the pointed path. If false, provided path will be considered as the working
* directory into which the .git directory will be created.
*
* @return 0 on success; error code otherwise
diff --git a/include/git2/tag.h b/include/git2/tag.h
index 11eac90e3..15635cce2 100644
--- a/include/git2/tag.h
+++ b/include/git2/tag.h
@@ -163,7 +163,7 @@ GIT_EXTERN(const char *) git_tag_message(git_tag *tag);
* @param repo Repository where to store the tag
*
* @param tag_name Name for the tag; this name is validated
- * for consistency. It should also not conflict with an
+ * for consistency. It should also not conflict with an
* already existing tag name
*
* @param target Object to which this tag points. This object
diff --git a/include/git2/tree.h b/include/git2/tree.h
index 80b90604f..5656f48f3 100644
--- a/include/git2/tree.h
+++ b/include/git2/tree.h
@@ -190,7 +190,7 @@ GIT_EXTERN(int) git_tree_create_fromindex(git_oid *oid, git_index *index);
*
* If the `source` parameter is not NULL, the tree builder
* will be initialized with the entries of the given tree.
- *
+ *
* If the `source` parameter is NULL, the tree builder will
* have no entries and will have to be filled manually.
*
diff --git a/include/git2/types.h b/include/git2/types.h
index 499ba98ad..85cf4ef78 100644
--- a/include/git2/types.h
+++ b/include/git2/types.h
@@ -66,7 +66,7 @@ typedef __haiku_std_int64 git_time_t;
#else /* POSIX */
-/*
+/*
* Note: Can't use off_t since if a client program includes <sys/types.h>
* before us (directly or indirectly), they'll get 32 bit off_t in their client
* app, even though /we/ define _FILE_OFFSET_BITS=64.
diff --git a/src/filebuf.c b/src/filebuf.c
index 01b36bcff..ea5599b6d 100644
--- a/src/filebuf.c
+++ b/src/filebuf.c
@@ -200,7 +200,7 @@ int git_filebuf_open(git_filebuf *file, const char *path, int flags)
char tmp_path[GIT_PATH_MAX];
/* Open the file as temporary for locking */
- file->fd = gitfo_mktemp(tmp_path, path);
+ file->fd = gitfo_mktemp(tmp_path, path);
if (file->fd < 0) {
error = GIT_EOSERR;
goto cleanup;
diff --git a/src/fileops.c b/src/fileops.c
index 936a6b4cc..3f0198dc4 100644
--- a/src/fileops.c
+++ b/src/fileops.c
@@ -475,7 +475,7 @@ int gitfo_prettify_dir_path(char *buffer_out, size_t size, const char *path, con
current++;
continue;
}
-
+
only_dots = 1;
segment_len = 0;
@@ -753,7 +753,7 @@ int gitfo_hide_directory__w32(const char *path)
error = SetFileAttributes(path, FILE_ATTRIBUTE_HIDDEN) != 0 ?
GIT_SUCCESS : GIT_ERROR; /* MSDN states a "non zero" value indicates a success */
- if (error < GIT_SUCCESS)
+ if (error < GIT_SUCCESS)
error = git__throw(GIT_EOSERR, "Failed to hide directory '%s'", path);
return error;
diff --git a/src/fileops.h b/src/fileops.h
index 229f6c4d7..d9fa96008 100644
--- a/src/fileops.h
+++ b/src/fileops.h
@@ -165,10 +165,10 @@ extern int gitfo_getcwd(char *buffer_out, size_t size);
/**
* Clean up a provided absolute or relative directory path.
- *
- * This prettification relies on basic operations such as coalescing
- * multiple forward slashes into a single slash, removing '.' and
- * './' current directory segments, and removing parent directory
+ *
+ * This prettification relies on basic operations such as coalescing
+ * multiple forward slashes into a single slash, removing '.' and
+ * './' current directory segments, and removing parent directory
* whenever '..' is encountered.
*
* If not empty, the returned path ends with a forward slash.
@@ -176,7 +176,7 @@ extern int gitfo_getcwd(char *buffer_out, size_t size);
* For instance, this will turn "d1/s1///s2/..//../s3" into "d1/s3/".
*
* This only performs a string based analysis of the path.
- * No checks are done to make sure the path actually makes sense from
+ * No checks are done to make sure the path actually makes sense from
* the file system perspective.
*
* @param buffer_out buffer to populate with the normalized path.
@@ -190,16 +190,16 @@ int gitfo_prettify_dir_path(char *buffer_out, size_t size, const char *path, con
/**
* Clean up a provided absolute or relative file path.
- *
- * This prettification relies on basic operations such as coalescing
- * multiple forward slashes into a single slash, removing '.' and
- * './' current directory segments, and removing parent directory
+ *
+ * This prettification relies on basic operations such as coalescing
+ * multiple forward slashes into a single slash, removing '.' and
+ * './' current directory segments, and removing parent directory
* whenever '..' is encountered.
*
* For instance, this will turn "d1/s1///s2/..//../s3" into "d1/s3".
*
* This only performs a string based analysis of the path.
- * No checks are done to make sure the path actually makes sense from
+ * No checks are done to make sure the path actually makes sense from
* the file system perspective.
*
* @param buffer_out buffer to populate with the normalized path.
diff --git a/src/hashtable.c b/src/hashtable.c
index b40737d67..86e5a113a 100644
--- a/src/hashtable.c
+++ b/src/hashtable.c
@@ -94,22 +94,22 @@ static void node_swap_with(git_hashtable_node *self, git_hashtable_node *other)
}
static int node_insert(git_hashtable *self, git_hashtable_node *new_node)
-{
+{
int iteration, hash_id;
- for (iteration = 0; iteration < MAX_LOOPS; iteration++) {
+ for (iteration = 0; iteration < MAX_LOOPS; iteration++) {
for (hash_id = 0; hash_id < GIT_HASHTABLE_HASHES; ++hash_id) {
git_hashtable_node *node;
node = node_with_hash(self, new_node->key, hash_id);
node_swap_with(new_node, node);
if(new_node->key == 0x0){
self->key_count++;
- return GIT_SUCCESS;
+ return GIT_SUCCESS;
}
}
}
- if (self->is_resizing)
+ if (self->is_resizing)
return git__throw(GIT_EBUSY, "Failed to insert node. Hashtable is currently resizing");
resize_to(self, self->size * 2);
@@ -130,7 +130,7 @@ static int insert_nodes(git_hashtable *self, git_hashtable_node *old_nodes, size
return GIT_SUCCESS;
}
-git_hashtable *git_hashtable_alloc(size_t min_size,
+git_hashtable *git_hashtable_alloc(size_t min_size,
git_hash_ptr hash,
git_hash_keyeq_ptr key_eq)
{
diff --git a/src/hashtable.h b/src/hashtable.h
index c3475b6ed..3a4e6a7e3 100644
--- a/src/hashtable.h
+++ b/src/hashtable.h
@@ -31,7 +31,7 @@ struct git_hashtable {
typedef struct git_hashtable_node git_hashtable_node;
typedef struct git_hashtable git_hashtable;
-git_hashtable *git_hashtable_alloc(size_t min_size,
+git_hashtable *git_hashtable_alloc(size_t min_size,
git_hash_ptr hash,
git_hash_keyeq_ptr key_eq);
void *git_hashtable_lookup(git_hashtable *h, const void *key);
diff --git a/src/index.c b/src/index.c
index 23fd52e09..ed91e050c 100644
--- a/src/index.c
+++ b/src/index.c
@@ -549,7 +549,7 @@ static int read_tree_internal(git_index_tree **out,
if (count == -1) {
/* FIXME: return buffer_end or the end position for
* this single tree entry */
- *buffer_in = buffer_end;
+ *buffer_in = buffer_end;
*out = NULL;
free_tree(tree); /* Needs to be done manually */
return GIT_SUCCESS;
diff --git a/src/odb.c b/src/odb.c
index 131093b83..0ee790e14 100644
--- a/src/odb.c
+++ b/src/odb.c
@@ -620,7 +620,7 @@ int git_odb_open_wstream(git_odb_stream **stream, git_odb *db, size_t size, git_
return git__rethrow(error, "Failed to open write stream");
}
-int git_odb_open_rstream(git_odb_stream **stream, git_odb *db, const git_oid *oid)
+int git_odb_open_rstream(git_odb_stream **stream, git_odb *db, const git_oid *oid)
{
unsigned int i;
int error = GIT_ERROR;
diff --git a/src/odb_pack.c b/src/odb_pack.c
index 2328f527c..2f95faee5 100644
--- a/src/odb_pack.c
+++ b/src/odb_pack.c
@@ -227,7 +227,7 @@ struct pack_backend {
-
+
/***********************************************************
*
* FORWARD DECLARATIONS
@@ -306,7 +306,7 @@ static off_t get_delta_base(struct pack_backend *backend,
static unsigned long packfile_unpack_header1(
size_t *sizep,
- git_otype *type,
+ git_otype *type,
const unsigned char *buf,
unsigned long len);
@@ -807,7 +807,7 @@ static int packfile_open(struct pack_file *p)
if (git_oid_cmp(&sha1, (git_oid *)idx_sha1) != 0)
goto cleanup;
- return GIT_SUCCESS;
+ return GIT_SUCCESS;
cleanup:
gitfo_close(p->pack_fd);
@@ -1068,7 +1068,7 @@ static int pack_entry_find1(
return git__rethrow(error, "Failed to find pack entry. Couldn't find offset");
/* we found a unique entry in the index;
- * make sure the packfile backing the index
+ * make sure the packfile backing the index
* still exists on disk */
if (p->pack_fd == -1 && packfile_open(p) < GIT_SUCCESS)
return git__throw(GIT_EOSERR, "Failed to find pack entry. Packfile doesn't exist on disk");
@@ -1177,7 +1177,7 @@ static int pack_entry_find_prefix(
static unsigned long packfile_unpack_header1(
size_t *sizep,
- git_otype *type,
+ git_otype *type,
const unsigned char *buf,
unsigned long len)
{
@@ -1385,7 +1385,7 @@ static int packfile_unpack(
size_t size = 0;
git_otype type;
- /*
+ /*
* TODO: optionally check the CRC on the packfile
*/
diff --git a/src/oid.c b/src/oid.c
index 70dd7c597..1f4a652c9 100644
--- a/src/oid.c
+++ b/src/oid.c
@@ -305,7 +305,7 @@ void git_oid_shorten_free(git_oid_shorten *os)
*
* - Each normal node points to 16 children (one for each possible
* character in the oid). This is *not* stored in an array of
- * pointers, because in a 64-bit arch this would be sucking
+ * pointers, because in a 64-bit arch this would be sucking
* 16*sizeof(void*) = 128 bytes of memory per node, which is fucking
* insane. What we do is store Node Indexes, and use these indexes
* to look up each node in the om->index array. These indexes are
diff --git a/src/pqueue.c b/src/pqueue.c
index 6307175e3..9883a35d8 100644
--- a/src/pqueue.c
+++ b/src/pqueue.c
@@ -11,7 +11,7 @@
* Copyright 2010 Volkan Yazıcı <volkan.yazici@gmail.com>
* Copyright 2006-2010 The Apache Software Foundation
*
- * This file is licensed under the Apache 2.0 license, which
+ * This file is licensed under the Apache 2.0 license, which
* supposedly makes it compatible with the GPLv2 that libgit2 uses.
*
* Check the Apache license at:
diff --git a/src/pqueue.h b/src/pqueue.h
index 7a1394803..ef8362c33 100644
--- a/src/pqueue.h
+++ b/src/pqueue.h
@@ -11,7 +11,7 @@
* Copyright 2010 Volkan Yazıcı <volkan.yazici@gmail.com>
* Copyright 2006-2010 The Apache Software Foundation
*
- * This file is licensed under the Apache 2.0 license, which
+ * This file is licensed under the Apache 2.0 license, which
* supposedly makes it compatible with the GPLv2 that libgit2 uses.
*
* Check the Apache license at:
diff --git a/src/refs.c b/src/refs.c
index 1bb385c32..ad81bb3c1 100644
--- a/src/refs.c
+++ b/src/refs.c
@@ -51,7 +51,7 @@ static uint32_t reftable_hash(const void *key, int hash_id)
static uint32_t hash_seeds[GIT_HASHTABLE_HASHES] = {
2147483647,
0x5d20bb23,
- 0x7daaab3c
+ 0x7daaab3c
};
return git__hash(key, strlen((const char *)key), hash_seeds[hash_id]);
@@ -230,9 +230,9 @@ static int loose_parse_symbolic(git_reference *ref, gitfo_buf *file_content)
return git__throw(GIT_EOBJCORRUPTED,
"Failed to parse loose reference. Object too short");
- /*
+ /*
* Assume we have already checked for the header
- * before calling this function
+ * before calling this function
*/
refname_start += header_len;
@@ -303,8 +303,8 @@ static git_rtype loose_guess_rtype(const char *full_path)
}
static int loose_lookup(
- git_reference **ref_out,
- git_repository *repo,
+ git_reference **ref_out,
+ git_repository *repo,
const char *name,
int skip_symbolic)
{
@@ -405,7 +405,7 @@ unlock:
static int packed_parse_peel(
reference_oid *tag_ref,
- const char **buffer_out,
+ const char **buffer_out,
const char *buffer_end)
{
const char *buffer = *buffer_out + 1;
@@ -525,7 +525,7 @@ static int packed_load(git_repository *repo)
git_hashtable_clear(repo->references.packfile);
} else {
ref_cache->packfile = git_hashtable_alloc(
- default_table_size,
+ default_table_size,
reftable_hash,
(git_hash_keyeq_ptr)strcmp);
@@ -680,7 +680,7 @@ static int packed_loadloose(git_repository *repository)
/*
* Load all the loose files from disk into the Packfile table.
* This will overwrite any old packed entries with their
- * updated loose versions
+ * updated loose versions
*/
return gitfo_dirent(refs_path, GIT_PATH_MAX, _dirent_loose_load, repository);
}
@@ -696,7 +696,7 @@ static int packed_write_ref(reference_oid *ref, git_filebuf *file)
git_oid_fmt(oid, &ref->oid);
oid[GIT_OID_HEXSZ] = 0;
- /*
+ /*
* For references that peel to an object in the repo, we must
* write the resulting peel on a separate line, e.g.
*
@@ -722,7 +722,7 @@ static int packed_write_ref(reference_oid *ref, git_filebuf *file)
/*
* Find out what object this reference resolves to.
*
- * For references that point to a 'big' tag (e.g. an
+ * For references that point to a 'big' tag (e.g. an
* actual tag object on the repository), we need to
* cache on the packfile the OID of the object to
* which that 'big tag' is pointing to.
@@ -998,7 +998,7 @@ int git_reference_lookup(git_reference **ref_out, git_repository *repo, const ch
/*
* If we cannot find a loose reference, we look into the packfile
- * Load the packfile first if it hasn't been loaded
+ * Load the packfile first if it hasn't been loaded
*/
/* load all the packed references */
error = packed_load(repo);
@@ -1234,7 +1234,7 @@ int git_reference_set_oid(git_reference *ref, const git_oid *id)
git_oid_cpy(&ref_oid->oid, id);
ref->type &= ~GIT_REF_HAS_PEEL;
- error = loose_write(ref);
+ error = loose_write(ref);
if (error < GIT_SUCCESS)
goto cleanup;
@@ -1445,7 +1445,7 @@ int git_reference_delete(git_reference *ref)
/* load the existing packfile */
if ((error = packed_load(ref->owner)) < GIT_SUCCESS)
return git__rethrow(error, "Failed to delete reference");
-
+
if (git_hashtable_remove(ref->owner->references.packfile, ref->name) < GIT_SUCCESS)
return git__throw(GIT_ENOTFOUND, "Reference not found");
@@ -1482,7 +1482,7 @@ int git_reference_resolve(git_reference **resolved_ref, git_reference *ref)
if ((error = loose_update(ref)) < GIT_SUCCESS)
return git__rethrow(error, "Failed to resolve reference");
-
+
repo = ref->owner;
for (i = 0; i < MAX_NESTING_LEVEL; ++i) {
diff --git a/src/repository.c b/src/repository.c
index e0927c077..8ebfd6745 100644
--- a/src/repository.c
+++ b/src/repository.c
@@ -118,7 +118,7 @@ static int assign_repository_dirs(
if (repo->path_index == NULL)
return GIT_ENOMEM;
}
-
+
return GIT_SUCCESS;
}
@@ -207,8 +207,8 @@ int git_repository_open3(git_repository **repo_out,
if (repo == NULL)
return GIT_ENOMEM;
- error = assign_repository_dirs(repo,
- git_dir,
+ error = assign_repository_dirs(repo,
+ git_dir,
NULL,
git_index_file,
git_work_tree);
@@ -247,7 +247,7 @@ int git_repository_open2(git_repository **repo_out,
return GIT_ENOMEM;
error = assign_repository_dirs(repo,
- git_dir,
+ git_dir,
git_object_directory,
git_index_file,
git_work_tree);
@@ -711,7 +711,7 @@ int git_repository_init(git_repository **repo_out, const char *path, unsigned is
int error = GIT_SUCCESS;
git_repository *repo = NULL;
repo_init results;
-
+
assert(repo_out && path);
results.path_repository = NULL;
diff --git a/src/signature.c b/src/signature.c
index 78cb78614..7d2333624 100644
--- a/src/signature.c
+++ b/src/signature.c
@@ -107,7 +107,7 @@ static int parse_timezone_offset(const char *buffer, long *offset_out)
const char *offset_start;
const char *offset_end;
- //we are sure that *buffer == ' '
+ //we are sure that *buffer == ' '
offset_start = buffer + 1;
if (*offset_start == '\n') {
@@ -133,7 +133,7 @@ static int parse_timezone_offset(const char *buffer, long *offset_out)
hours = dec_offset / 100;
mins = dec_offset % 100;
- if (hours > 14) // see http://www.worldtimezone.com/faq.html
+ if (hours > 14) // see http://www.worldtimezone.com/faq.html
return git__throw(GIT_EOBJCORRUPTED, "Failed to parse TZ offset. Hour value too large");
if (mins > 59)
@@ -143,7 +143,7 @@ static int parse_timezone_offset(const char *buffer, long *offset_out)
if (offset_start[0] == '-')
offset *= -1;
-
+
*offset_out = offset;
return GIT_SUCCESS;
@@ -218,7 +218,7 @@ int git_signature__parse(git_signature *sig, const char **buffer_out,
if (parse_timezone_offset(buffer, &offset) < GIT_SUCCESS)
return git__throw(GIT_EOBJCORRUPTED, "Failed to parse signature. Could not parse timezone offset");
-
+
sig->when.offset = offset;
*buffer_out = (line_end + 1);
@@ -234,7 +234,7 @@ int git_signature__write(char **signature, const char *header, const git_signatu
offset = sig->when.offset;
sign = (sig->when.offset < 0) ? '-' : '+';
-
+
if (offset < 0)
offset = -offset;
diff --git a/src/tag.c b/src/tag.c
index 45450b933..53e28f526 100644
--- a/src/tag.c
+++ b/src/tag.c
@@ -205,7 +205,7 @@ int git_tag_create(
return git__throw(GIT_EINVALIDARGS, "The given target does not belong to this repository");
error = retreive_tag_reference(&new_ref, ref_name, repo, tag_name);
-
+
switch (error) {
case GIT_SUCCESS:
case GIT_ENOTFOUND:
@@ -215,7 +215,7 @@ int git_tag_create(
return git__rethrow(error, "Failed to create tag");
}
- /** Ensure the tag name doesn't conflict with an already existing
+ /** Ensure the tag name doesn't conflict with an already existing
* reference unless overwriting has explictly been requested **/
if (new_ref != NULL) {
if (!allow_ref_overwrite) {
@@ -268,7 +268,7 @@ int git_tag_create(
error = git_reference_create_oid(&new_ref, repo, ref_name, oid, 0);
else
error = git_reference_set_oid(new_ref, oid);
-
+
return error == GIT_SUCCESS ? GIT_SUCCESS : git__rethrow(error, "Failed to create tag");
}
@@ -278,14 +278,14 @@ int git_tag_create_frombuffer(git_oid *oid, git_repository *repo, const char *bu
int error, should_update_ref = 0;
git_odb_stream *stream;
git_odb_object *target_obj;
-
+
git_reference *new_ref;
char ref_name[GIT_REFNAME_MAX];
-
+
assert(oid && buffer);
-
+
memset(&tag, 0, sizeof(tag));
-
+
/* validate the buffer */
if ((error = parse_tag_buffer(&tag, buffer, buffer + strlen(buffer))) < GIT_SUCCESS)
return git__rethrow(error, "Failed to create tag");
@@ -298,7 +298,7 @@ int git_tag_create_frombuffer(git_oid *oid, git_repository *repo, const char *bu
return git__throw(error, "The type for the given target is invalid");
git_odb_object_close(target_obj);
-
+
error = retreive_tag_reference(&new_ref, ref_name, repo, tag.tag_name);
switch (error) {
@@ -320,16 +320,16 @@ int git_tag_create_frombuffer(git_oid *oid, git_repository *repo, const char *bu
should_update_ref = 1;
}
}
-
+
/* write the buffer */
if ((error = git_odb_open_wstream(&stream, repo->db, strlen(buffer), GIT_OBJ_TAG)) < GIT_SUCCESS)
return git__rethrow(error, "Failed to create tag");
-
+
stream->write(stream, buffer, strlen(buffer));
-
+
error = stream->finalize_write(oid, stream);
stream->free(stream);
-
+
if (error < GIT_SUCCESS)
return git__rethrow(error, "Failed to create tag");
@@ -337,11 +337,11 @@ int git_tag_create_frombuffer(git_oid *oid, git_repository *repo, const char *bu
error = git_reference_create_oid(&new_ref, repo, ref_name, oid, 0);
else
error = git_reference_set_oid(new_ref, oid);
-
+
git_signature_free(tag.tagger);
free(tag.tag_name);
free(tag.message);
-
+
return error == GIT_SUCCESS ? GIT_SUCCESS : git__rethrow(error, "Failed to create tag");
}
diff --git a/src/tree.c b/src/tree.c
index 2c10ab8a4..6a21709f5 100644
--- a/src/tree.c
+++ b/src/tree.c
@@ -34,7 +34,7 @@
#define MAX_FILEMODE_BYTES 6
static int valid_attributes(const int attributes) {
- return attributes >= 0 && attributes <= MAX_FILEMODE;
+ return attributes >= 0 && attributes <= MAX_FILEMODE;
}
int entry_search_cmp(const void *key, const void *array_member)
@@ -47,7 +47,7 @@ int entry_search_cmp(const void *key, const void *array_member)
#if 0
static int valid_attributes(const int attributes) {
- return attributes >= 0 && attributes <= MAX_FILEMODE;
+ return attributes >= 0 && attributes <= MAX_FILEMODE;
}
#endif
@@ -215,9 +215,9 @@ static int write_index(git_oid *oid, git_index *index, const char *base, int bas
buffer = git__malloc(size);
if (buffer == NULL)
return GIT_ENOMEM;
-
+
offset = 0;
-
+
for (nr = entry_no; nr < maxentries; ++nr) {
git_index_entry *entry = git_index_get(index, nr);
@@ -227,11 +227,11 @@ static int write_index(git_oid *oid, git_index *index, const char *base, int bas
unsigned int write_mode;
git_oid subtree_oid;
git_oid *write_oid;
-
+
/* Did we hit the end of the directory? Return how many we wrote */
if (baselen >= pathlen || memcmp(base, pathname, baselen) != 0)
break;
-
+
/* Do we have _further_ subdirectories? */
filename = pathname + baselen;
dirname = strchr(filename, '/');
@@ -254,9 +254,9 @@ static int write_index(git_oid *oid, git_index *index, const char *base, int bas
free(buffer);
return subdir_written;
}
-
+
nr = subdir_written - 1;
-
+
/* Now we need to write out the directory entry into this tree.. */
pathlen = dirname - pathname;
write_oid = &subtree_oid;
@@ -267,14 +267,14 @@ static int write_index(git_oid *oid, git_index *index, const char *base, int bas
if (offset + entrylen + 32 > size) {
size = alloc_nr(offset + entrylen + 32);
buffer = git__realloc(buffer, size);
-
+
if (buffer == NULL)
return GIT_ENOMEM;
}
offset += write_index_entry(buffer + offset, write_mode, filename, entrylen, write_oid);
}
-
+
error = git_odb_write(oid, index->repository->db, buffer, offset, GIT_OBJ_TREE);
free(buffer);
diff --git a/src/util.c b/src/util.c
index f36cce5fe..b654e08d1 100644
--- a/src/util.c
+++ b/src/util.c
@@ -427,17 +427,17 @@ uint32_t git__hash(const void *key, int len, unsigned int seed)
while(len >= 4) {
uint32_t k = *(uint32_t *)data;
- k *= m;
- k ^= k >> r;
- k *= m;
-
- h *= m;
+ k *= m;
+ k ^= k >> r;
+ k *= m;
+
+ h *= m;
h ^= k;
data += 4;
len -= 4;
}
-
+
switch(len) {
case 3: h ^= data[2] << 16;
case 2: h ^= data[1] << 8;
@@ -450,7 +450,7 @@ uint32_t git__hash(const void *key, int len, unsigned int seed)
h ^= h >> 15;
return h;
-}
+}
#else
/*
Cross-platform version of Murmurhash3
@@ -508,5 +508,5 @@ uint32_t git__hash(const void *key, int len, uint32_t seed)
h1 ^= h1 >> 16;
return h1;
-}
+}
#endif
diff --git a/src/util.h b/src/util.h
index c81dd7897..999c3b8aa 100644
--- a/src/util.h
+++ b/src/util.h
@@ -5,7 +5,7 @@
#define bitsizeof(x) (CHAR_BIT * sizeof(x))
#define MSB(x, bits) ((x) & (~0ULL << (bitsizeof(x) - (bits))))
-/*
+/*
* Custom memory allocation wrappers
* that set error code and error message
* on allocation failure
@@ -78,7 +78,7 @@ extern int git__strtol32(long *n, const char *buff, const char **end_buf, int ba
* the string ".". If path is a null pointer or points to an empty string,
* dirname() shall return a pointer to the string "." .
*
- * The `git__dirname` implementation is thread safe. The returned
+ * The `git__dirname` implementation is thread safe. The returned
* string must be manually free'd.
*
* The `git__dirname_r` implementation expects a string allocated
@@ -96,7 +96,7 @@ extern int git__dirname_r(char *buffer, size_t bufflen, const char *path);
* Trailing slashes and backslashes are significant: the basename of
* c:/foo/bar/ is an empty string after the rightmost slash.
*
- * The `git__basename` implementation is thread safe. The returned
+ * The `git__basename` implementation is thread safe. The returned
* string must be manually free'd.
*
* The `git__basename_r` implementation expects a string allocated
@@ -112,7 +112,7 @@ extern const char *git__topdir(const char *path);
* middle slashes and everything
*
* The paths are joined together into buffer_out; this is expected
- * to be an user allocated buffer of `GIT_PATH_MAX` size
+ * to be an user allocated buffer of `GIT_PATH_MAX` size
*/
extern void git__joinpath_n(char *buffer_out, int npath, ...);
diff --git a/src/vector.c b/src/vector.c
index 1ddc26e3e..0451eb082 100644
--- a/src/vector.c
+++ b/src/vector.c
@@ -61,7 +61,7 @@ int git_vector_init(git_vector *v, unsigned int initial_size, git_vector_cmp cmp
v->_alloc_size = initial_size;
v->_cmp = cmp;
-
+
v->length = 0;
v->sorted = 1;
diff --git a/tests/t00-core.c b/tests/t00-core.c
index 31ed8c38b..e1aa6b8f9 100644
--- a/tests/t00-core.c
+++ b/tests/t00-core.c
@@ -241,7 +241,7 @@ BEGIN_TEST(path3, "prettify and validate a path to a file")
must_fail(ensure_file_path_normalized("d1/...", NULL, 0));
must_fail(ensure_file_path_normalized("d1/.../", NULL, 0));
must_fail(ensure_file_path_normalized("d1/.../d2", NULL, 0));
-
+
must_pass(ensure_file_path_normalized("/a", "/a", ROOTED_PATH));
must_pass(ensure_file_path_normalized("/./testrepo.git", "/testrepo.git", ROOTED_PATH));
must_pass(ensure_file_path_normalized("/./.git", "/.git", ROOTED_PATH));
diff --git a/tests/t02-objread.c b/tests/t02-objread.c
index 8f11e9e33..4bcff2742 100644
--- a/tests/t02-objread.c
+++ b/tests/t02-objread.c
@@ -210,7 +210,7 @@ BEGIN_TEST(readheader0, "read only the header of several packed objects")
git_odb_object_close(obj);
}
- git_odb_close(db);
+ git_odb_close(db);
END_TEST
BEGIN_TEST(readheader1, "read only the header of several loose objects")
diff --git a/tests/t04-commit.c b/tests/t04-commit.c
index b7e0afe1e..415017aba 100644
--- a/tests/t04-commit.c
+++ b/tests/t04-commit.c
@@ -359,7 +359,7 @@ BEGIN_TEST(details0, "query the details on a parsed commit")
git_repository *repo;
must_pass(git_repository_open(&repo, REPOSITORY_FOLDER));
-
+
for (i = 0; i < commit_count; ++i) {
git_oid id;
git_commit *commit;
diff --git a/tests/t05-revwalk.c b/tests/t05-revwalk.c
index ac5de2167..ab509ab94 100644
--- a/tests/t05-revwalk.c
+++ b/tests/t05-revwalk.c
@@ -74,7 +74,7 @@ static int get_commit_index(git_oid *raw_oid)
char oid[40];
git_oid_fmt(oid, raw_oid);
-
+
for (i = 0; i < commit_count; ++i)
if (memcmp(oid, commit_ids[i], 40) == 0)
return i;
@@ -108,7 +108,7 @@ static int test_walk(git_revwalk *walk, const git_oid *root,
}*/
}
- for (i = 0; i < results_count; ++i)
+ for (i = 0; i < results_count; ++i)
if (memcmp(possible_results[i],
result_array, result_bytes) == 0)
return GIT_SUCCESS;
diff --git a/tests/t06-index.c b/tests/t06-index.c
index 27819c02a..6a46719ed 100644
--- a/tests/t06-index.c
+++ b/tests/t06-index.c
@@ -145,7 +145,7 @@ BEGIN_TEST(write0, "write an index back to disk")
must_pass(cmp_files(TEST_INDEXBIG_PATH, "index_rewrite"));
git_index_free(index);
-
+
gitfo_unlink("index_rewrite");
END_TEST
diff --git a/tests/t10-refs.c b/tests/t10-refs.c
index 7b4ae5e1b..f975c8fba 100644
--- a/tests/t10-refs.c
+++ b/tests/t10-refs.c
@@ -431,7 +431,7 @@ BEGIN_TEST(pack0, "create a packfile for an empty folder")
const int mode = 0755; /* or 0777 ? */
must_pass(open_temp_repo(&repo, REPOSITORY_FOLDER));
-
+
git__joinpath_n(temp_path, 3, repo->path_repository, GIT_REFS_HEADS_DIR, "empty_dir");
must_pass(gitfo_mkdir_recurs(temp_path, mode));
@@ -446,12 +446,12 @@ BEGIN_TEST(pack1, "create a packfile from all the loose rn a repo")
char temp_path[GIT_PATH_MAX];
must_pass(open_temp_repo(&repo, REPOSITORY_FOLDER));
-
+
/* Ensure a known loose ref can be looked up */
must_pass(git_reference_lookup(&reference, repo, loose_tag_ref_name));
must_be_true((reference->type & GIT_REF_PACKED) == 0);
must_be_true(strcmp(reference->name, loose_tag_ref_name) == 0);
-
+
/*
* We are now trying to pack also a loose reference
* called `points_to_blob`, to make sure we can properly
@@ -913,7 +913,7 @@ BEGIN_TEST(list0, "try to list all the references in our test repo")
/* We have exactly 8 refs in total if we include the packed ones:
* there is a reference that exists both in the packfile and as
* loose, but we only list it once */
- must_be_true(ref_list.count == 8);
+ must_be_true(ref_list.count == 8);
git_strarray_free(&ref_list);
git_repository_free(repo);
@@ -925,7 +925,7 @@ BEGIN_TEST(list1, "try to list only the symbolic references")
must_pass(git_repository_open(&repo, REPOSITORY_FOLDER));
must_pass(git_reference_listall(&ref_list, repo, GIT_REF_SYMBOLIC));
- must_be_true(ref_list.count == 0); /* no symrefs in the test repo */
+ must_be_true(ref_list.count == 0); /* no symrefs in the test repo */
git_strarray_free(&ref_list);
git_repository_free(repo);
diff --git a/tests/test_lib.h b/tests/test_lib.h
index 69ad2edde..fc75ed771 100755
--- a/tests/test_lib.h
+++ b/tests/test_lib.h
@@ -15,7 +15,7 @@
#define BEGIN_SUITE(SNAME) \
git_testsuite *libgit2_suite_##SNAME(void) {\
git_testsuite *_gitsuite = git_testsuite_new(#SNAME);
-
+
#define ADD_TEST(TNAME) \
git_testsuite_add(_gitsuite, _gittest__##TNAME);