GNOME Bugzilla – Bug 702666
Clone fails when the folder already exists
Last modified: 2013-09-07 13:59:03 UTC
The flow is this, 1. I have a path: "/tmp" 2. Inside it an empty folder gitg 3. Open gitg, click clone 4. URI: git://git.gnome.org/gitg; Local folder: /tmp 5. Hit [clone] Gitg fails silently. How it fails: A new row appears, but there's no repo there. So when you click on it, no history loading at all. PS: the problem should be with no communicating git return value, since git fails when cloning a repo to an existing path.
I can confirm this. I receive an message in terminal: "** (gitg:22344): WARNING **: gitg-gtk-dash-view.vala:324: error creating subfolder: Error creating directory: File exists" Changing bug status to 'NEW'.
I took a look at the code and https://git.gnome.org/browse/gitg/tree/libgitg-gtk/gitg-gtk-dash-view.vala#n324 can be routed to the proposed GtkInfobar? This would also solve bug 699153, bug 699146 when we route those error messages through the Infobar :)
Created attachment 247514 [details] [review] Based on bug 699146, this routes clone repository dialog error's via a signal to show_infobar Please review, thanks!
This doesn't look like the right approach to me. There will probably be many other cases where we need to show errors. What about adding a show_error function on GitgExt.Application, having Gitg.Window implementing it to show the error in the info bar?
See that the dash is a widget, so we need a way to retrieve the error from it and not make it depend on GitgExt.Application...
Ok, that makes sense. For plugins though, it would be nice to expose a show_error on GitgExt.Application.
Is this the commit https://git.gnome.org/browse/gitg/commit/?id=564f6da5d5e74a27f457d414092f390aba7e1889 that exposes show_infobar on GitgExt.Application?
Review of attachment 247514 [details] [review]: This patch still makes sense though. Please rebase it to current master and push. Thanks!
Created attachment 253995 [details] [review] Fix Clone Repository dialog error The patch didn't apply cleanly because since the patch was written, a couple of things in the API have changed. Here's the fresh patch. Please review. Thank you.
Created attachment 254345 [details] [review] Fix Clone Repository dialog error Updated patch based on http://fpaste.org/37294/83853361/raw/ < review on IRC. Please review, again. Thank you.
Review of attachment 254345 [details] [review]: looks good
Pushed to master in e5c30050d011ac9deaa91cda90547ca08f308f3d Available at: https://git.gnome.org/browse/gitg/commit/?id=e5c30050d011ac9deaa91cda90547ca08f308f3d Closing bug as RESOLVED and FIXED. Thank you for the reviews.