summaryrefslogtreecommitdiff
path: root/include/git2
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-10-08 16:35:57 -0700
committerRussell Belfer <rb@github.com>2013-10-08 16:35:57 -0700
commit92dac975869bf6207eca0754345dc9aa7fec8992 (patch)
treed210c8864e8cb2fba474b70057ed4655fda5535b /include/git2
parentd5e83627e4ed764115175dc42090afe0df332fe3 (diff)
downloadlibgit2-92dac975869bf6207eca0754345dc9aa7fec8992.tar.gz
Make reference lookups apply precomposeunicode
Before these changes, looking up a reference would return the same precomposed or decomposed form of the reference name that was used to look it up, so on MacOS which ignores the difference between the two, a single reference could be looked up either way and git_reference_name would return the form of the name that was used to look it up! This change makes lookup always return the precomposed name if core.precomposeunicode is set regardless of which version was used to look it up. The reference iterator was already returning the precomposed form from earlier work. This also updates the CMakeLists.txt rules for enabling iconv usage because the clar tests for this code were actually not being activated properly with the old version. Finally, this moves git_repository_reset_filesystem from include/ git2/repository.h to include/git2/sys/repository.h since it is not really a function that normal library users should have to think about very often.
Diffstat (limited to 'include/git2')
-rw-r--r--include/git2/refs.h8
-rw-r--r--include/git2/repository.h19
-rw-r--r--include/git2/sys/repository.h20
3 files changed, 23 insertions, 24 deletions
diff --git a/include/git2/refs.h b/include/git2/refs.h
index 4871e9820..4041947f6 100644
--- a/include/git2/refs.h
+++ b/include/git2/refs.h
@@ -453,7 +453,7 @@ GIT_EXTERN(int) git_reference_is_remote(git_reference *ref);
GIT_EXTERN(int) git_reference_is_tag(git_reference *ref);
typedef enum {
- GIT_REF_FORMAT_NORMAL = 0,
+ GIT_REF_FORMAT_NORMAL = 0u,
/**
* Control whether one-level refnames are accepted
@@ -461,7 +461,7 @@ typedef enum {
* components). Those are expected to be written only using
* uppercase letters and underscore (FETCH_HEAD, ...)
*/
- GIT_REF_FORMAT_ALLOW_ONELEVEL = (1 << 0),
+ GIT_REF_FORMAT_ALLOW_ONELEVEL = (1u << 0),
/**
* Interpret the provided name as a reference pattern for a
@@ -470,14 +470,14 @@ typedef enum {
* in place of a one full pathname component
* (e.g., foo/<star>/bar but not foo/bar<star>).
*/
- GIT_REF_FORMAT_REFSPEC_PATTERN = (1 << 1),
+ GIT_REF_FORMAT_REFSPEC_PATTERN = (1u << 1),
/**
* Interpret the name as part of a refspec in shorthand form
* so the `ONELEVEL` naming rules aren't enforced and 'master'
* becomes a valid name.
*/
- GIT_REF_FORMAT_REFSPEC_SHORTHAND = (1 << 2),
+ GIT_REF_FORMAT_REFSPEC_SHORTHAND = (1u << 2),
} git_reference_normalize_t;
/**
diff --git a/include/git2/repository.h b/include/git2/repository.h
index 28d8400f2..b4d561992 100644
--- a/include/git2/repository.h
+++ b/include/git2/repository.h
@@ -288,25 +288,6 @@ GIT_EXTERN(int) git_repository_init_ext(
git_repository_init_options *opts);
/**
- * Update the filesystem config settings for an open repository
- *
- * When a repository is initialized, config values are set based on the
- * properties of the filesystem that the repository is on, such as
- * "core.ignorecase", "core.filemode", "core.symlinks", etc. If the
- * repository is moved to a new filesystem, these properties may no
- * longer be correct and API calls may not behave as expected. This
- * call reruns the phase of repository initialization that sets those
- * properties to compensate for the current filesystem of the repo.
- *
- * @param repo A repository object
- * @param recurse_submodules Should submodules be reset recursively
- * @returrn 0 on success, < 0 on error
- */
-GIT_EXTERN(int) git_repository_reset_filesystem(
- git_repository *repo,
- int recurse_submodules);
-
-/**
* Retrieve and resolve the reference pointed at by HEAD.
*
* The returned `git_reference` will be owned by caller and
diff --git a/include/git2/sys/repository.h b/include/git2/sys/repository.h
index ba3d65ae5..e77b1dcba 100644
--- a/include/git2/sys/repository.h
+++ b/include/git2/sys/repository.h
@@ -27,7 +27,6 @@ GIT_BEGIN_DECL
*/
GIT_EXTERN(int) git_repository_new(git_repository **out);
-
/**
* Reset all the internal state in a repository.
*
@@ -42,6 +41,25 @@ GIT_EXTERN(int) git_repository_new(git_repository **out);
GIT_EXTERN(void) git_repository__cleanup(git_repository *repo);
/**
+ * Update the filesystem config settings for an open repository
+ *
+ * When a repository is initialized, config values are set based on the
+ * properties of the filesystem that the repository is on, such as
+ * "core.ignorecase", "core.filemode", "core.symlinks", etc. If the
+ * repository is moved to a new filesystem, these properties may no
+ * longer be correct and API calls may not behave as expected. This
+ * call reruns the phase of repository initialization that sets those
+ * properties to compensate for the current filesystem of the repo.
+ *
+ * @param repo A repository object
+ * @param recurse_submodules Should submodules be reset recursively
+ * @returrn 0 on success, < 0 on error
+ */
+GIT_EXTERN(int) git_repository_reset_filesystem(
+ git_repository *repo,
+ int recurse_submodules);
+
+/**
* Set the configuration file for this repository
*
* This configuration file will be used for all configuration