1 /* This file is part of giggle
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
;
32 callback (GiggleGit
* git
,
37 GMainLoop
* mainloop
= loop
;
38 GList
* branches
= giggle_git_refs_get_branches (GIGGLE_GIT_REFS (job
));
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
);
68 loop
= g_main_loop_new (NULL
, FALSE
);
70 dir
= g_build_filename (g_get_current_dir (),
75 git
= giggle_git_get ();
76 g_return_val_if_fail (giggle_git_set_directory (git
, dir
, NULL
), 1);
80 job
= giggle_git_refs_new ();
81 giggle_git_run_job (git
, job
,
84 g_main_loop_run (loop
);
86 return passed
== TRUE
? 0 : 1;