[gitg] Better argument parsing (pass first argument to git log)
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gitg] Better argument parsing (pass first argument to git log)
- Date: Fri, 19 Aug 2011 19:03:49 +0000 (UTC)
commit 59a82057f130b5941ff36bcaee4ef2f23f972d8a
Author: Jesse van den Kieboom <jesse vandenkieboom epfl ch>
Date: Fri Aug 19 21:03:27 2011 +0200
Better argument parsing (pass first argument to git log)
gitg/gitg-window.c | 18 +++++++++++++++---
1 files changed, 15 insertions(+), 3 deletions(-)
---
diff --git a/gitg/gitg-window.c b/gitg/gitg-window.c
index 7ae2fce..21c1e71 100644
--- a/gitg/gitg-window.c
+++ b/gitg/gitg-window.c
@@ -1979,15 +1979,25 @@ load_repository_for_command_line (GitgWindow *window,
}
g_free (uri);
- g_object_unref (first_arg);
if (git_dir || (work_tree && g_file_query_exists (work_tree, NULL)))
{
+ gint offset;
+
+ if (git_dir && !g_file_equal (git_dir, first_arg))
+ {
+ offset = 0;
+ }
+ else
+ {
+ offset = 1;
+ }
+
ret = load_repository (window,
git_dir,
work_tree,
- argc - 1,
- argv + 1,
+ argc - offset,
+ argv + offset,
selection ? selection : sel);
if (ret && activatable)
@@ -2000,6 +2010,8 @@ load_repository_for_command_line (GitgWindow *window,
g_free (activatable);
g_free (action);
g_free (work_tree_path);
+
+ g_object_unref (first_arg);
}
if (!ret)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]