[gitg] Remove redundant revert_index
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gitg] Remove redundant revert_index
- Date: Sat, 6 Jul 2013 08:23:28 +0000 (UTC)
commit dfd45efb82d807105cdf4b58dc4753787629ab44
Author: Jesse van den Kieboom <jessevdk gmail com>
Date: Sat Jul 6 10:12:43 2013 +0200
Remove redundant revert_index
gitg/commit/gitg-commit.vala | 4 ++--
libgitg/gitg-stage.vala | 41 -----------------------------------------
2 files changed, 2 insertions(+), 43 deletions(-)
---
diff --git a/gitg/commit/gitg-commit.vala b/gitg/commit/gitg-commit.vala
index 6588dff..5fe6598 100644
--- a/gitg/commit/gitg-commit.vala
+++ b/gitg/commit/gitg-commit.vala
@@ -215,10 +215,10 @@ namespace GitgCommit
{
var stage = application.repository.stage;
- stage.revert_index_path.begin(f.path, (obj, res) => {
+ stage.unstage_path.begin(f.path, (obj, res) => {
try
{
- stage.revert_index_path.end(res);
+ stage.unstage_path.end(res);
}
catch (Error e)
{
diff --git a/gitg/lala b/gitg/lala
new file mode 100644
index 0000000..e69de29
diff --git a/libgitg/gitg-stage.vala b/libgitg/gitg-stage.vala
index 39e6a47..1a9e7ed 100644
--- a/libgitg/gitg-stage.vala
+++ b/libgitg/gitg-stage.vala
@@ -110,34 +110,6 @@ public class Stage : Object
});
}
- /**
- * Revert index changes.
- *
- * @param file the file to revert.
- *
- * Revert a file in the index to the version currently recorded in HEAD.
- * Note that this only affects the index, not the working directory.
- */
- public async void revert_index(File file) throws Error
- {
- var tree = yield get_head_tree();
-
- yield thread_index((index) => {
- // get path relative to the repository working directory
- var wd = d_repository.get_workdir();
- var path = wd.get_relative_path(file);
-
- // get the tree entry of that file
- var entry = tree.get_by_path(path);
- var id = entry.get_id();
-
- var ientry = d_repository.create_index_entry_for_file(file, id);
- index.add(ientry);
-
- index.write();
- });
- }
-
private string message_with_sign_off(string message,
Ggit.Signature committer)
{
@@ -429,19 +401,6 @@ public class Stage : Object
}
/**
- * Revert index changes.
- *
- * @param path path relative to the working directory.
- *
- * Revert a path in the index to the version currently recorded in HEAD.
- * Note that this only affects the index, not the working directory.
- */
- public async void revert_index_path(string path) throws Error
- {
- yield revert_index(d_repository.get_workdir().resolve_relative_path(path));
- }
-
- /**
* Revert working directory changes.
*
* @param file the file to revert.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]