changed the refresh hotkey
[giggle.git] / test / check-bare.c
blob9e4429482b45f66778b6597da24ca771698c37e8
1 /* This file is part of giggle
3 * AUTHORS
4 * Sven Herzberg <herzi@gnome-de.org>
6 * Copyright (C) 2007 Sven Herzberg
8 * This work is provided "as is"; redistribution and modification
9 * in whole or in part, in any medium, physical or electronic is
10 * permitted without restriction.
12 * This work is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16 * In no event shall the authors or contributors be liable for any
17 * direct, indirect, incidental, special, exemplary, or consequential
18 * damages (including, but not limited to, procurement of substitute
19 * goods or services; loss of use, data, or profits; or business
20 * interruption) however caused and on any theory of liability, whether
21 * in contract, strict liability, or tort (including negligence or
22 * otherwise) arising in any way out of the use of this software, even
23 * if advised of the possibility of such damage.
26 #include <giggle-git.h>
27 #include <giggle-git-refs.h>
29 static gboolean passed = TRUE;
31 static void
32 callback (GiggleGit* git,
33 GiggleJob* job,
34 GError * error,
35 gpointer loop)
37 GMainLoop* mainloop = loop;
38 GList * branches = giggle_git_refs_get_branches (GIGGLE_GIT_REFS (job));
39 gchar * compare[] = {
40 "clean-makefile-am",
41 "master",
42 "multi-root-test",
43 "tests"
45 guint i;
47 for (i = 0; branches && i < G_N_ELEMENTS (compare); branches = branches->next, i++) {
48 if (strcmp (compare[i], giggle_ref_get_name (branches->data))) {
49 g_warning ("Branch %d was %s (expected: %s)",
50 i, giggle_ref_get_name (branches->data), compare[i]);
54 g_main_loop_quit (loop);
57 int
58 main (int argc,
59 char**argv)
61 GMainLoop* loop;
62 GiggleGit* git;
63 GiggleJob* job;
64 gchar* dir;
66 g_type_init ();
68 loop = g_main_loop_new (NULL, FALSE);
70 dir = g_build_filename (g_get_current_dir (),
71 g_getenv ("srcdir"),
72 "multi-root.git",
73 NULL);
75 git = giggle_git_get ();
76 g_return_val_if_fail (giggle_git_set_directory (git, dir, NULL), 1);
78 g_free (dir);
80 job = giggle_git_refs_new ();
81 giggle_git_run_job (git, job,
82 callback, loop);
84 g_main_loop_run (loop);
86 return passed == TRUE ? 0 : 1;