summaryrefslogtreecommitdiff
path: root/include/git2/index.h
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-11-01 09:51:01 -0700
committerRussell Belfer <rb@github.com>2013-11-01 10:20:51 -0700
commit8e5a8ef86f1d528472884f737612083abda86e17 (patch)
tree71b090fb4b7c91b8aa54b31fd458e768fec86625 /include/git2/index.h
parent4bf630b6baf342fa929a8f7e4e6643197b74216f (diff)
downloadlibgit2-8e5a8ef86f1d528472884f737612083abda86e17.tar.gz
Convert git_index_read to have a "force" flag
This is a little more intuitive than the turned-around option that I originally wrote.
Diffstat (limited to 'include/git2/index.h')
-rw-r--r--include/git2/index.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/include/git2/index.h b/include/git2/index.h
index 7de106624..a60db370a 100644
--- a/include/git2/index.h
+++ b/include/git2/index.h
@@ -225,20 +225,20 @@ GIT_EXTERN(int) git_index_set_caps(git_index *index, unsigned int caps);
* Update the contents of an existing index object in memory by reading
* from the hard disk.
*
- * Pass 0 for `only_if_changed` to perform a "hard" read that discards
- * in-memory changes and always reloads the on-disk index data. If there
- * is no on-disk version, the index will be cleared.
+ * If `force` is true, this performs a "hard" read that discards in-memory
+ * changes and always reloads the on-disk index data. If there is no
+ * on-disk version, the index will be cleared.
*
- * Pass non-zero for `only_if_changed` to perform a "soft" read that only
- * reloads the index data if it has changed since the last time it was
- * loaded. In-memory index data will be untouched. Be aware: if there
- * are changes on disk, unwritten in-memory changes will be discarded.
+ * If `force` is false, this does a "soft" read that reloads the index
+ * data from disk only if it has changed since the last time it was
+ * loaded. Purely in-memory index data will be untouched. Be aware: if
+ * there are changes on disk, unwritten in-memory changes are discarded.
*
* @param index an existing index object
- * @param only_if_changed only read if on-disk file is newer than last read
+ * @param force if true, always reload, vs. only read if file has changed
* @return 0 or an error code
*/
-GIT_EXTERN(int) git_index_read(git_index *index, int only_if_changed);
+GIT_EXTERN(int) git_index_read(git_index *index, int force);
/**
* Write an existing index object from memory back to disk